Upgrade Docker container

Yesterday I upgraded to v1.20.3 with “docker-compose pull” and “docker-compose up -d” commands. The problem is that after this I lost my configuration. This happens bacause composer recreated /config folder?

I guess that depends on your compose file. You should use a volume for the config and database, which would persist it accross container recreates.

This is my yaml:

version: "3.9"
services:
  syncthing:
    image: syncthing/syncthing:latest
    container_name: syncthing
    hostname: syncthing
    environment:
      - PUID=33
      - PGID=33
      - TZ=Europe/Rome
    volumes:
      - /var/lib/docker/volumes/syncthing/config:/config
      - /srv/dev-disk-by-uuid-83ecb729-27d8-492f-9a9e-94832266f12a/Nas:/nas
    ports:
      - 8384:8384
      - 22000:22000/tcp
      - 21027:21027/udp
    restart: always

The strange thing is that /var/lib/docker/volumes/syncthing/config is empty.

Our container image doesn’t use /config where you’ve mapped the volume, it uses /var/syncthing. We apparently even have a compose example nowadays.

1 Like

That was the problem, thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.