Auto upgrade on docker forces "re-install"

I have a gitea running as a stack in docker. I also have watchtower running on teh same docker instance. I find that as releases get pushed out - my gitea goes through the install page - which is annoying because I have to fill in everything again only to be told “are you sure”?

For now I am going to tell watchtower to ignore the gitea container - but this is just putting my problems off.

Any suggestions as to how to setup Gitea’s docker compose so it doesn’t need to “re-install” each time I upgrade?

here is my current compose(with default passwords)

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest-rootless
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea
      - GITEA__webhook__SKIP_TLS_VERIFY=true
    restart: always
    networks:
      - gitea
    volumes:
      - /data/gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "222:22"
    depends_on:
      - db
    labels:
      - "com.centurylinklabs.watchtower.enable=false"

  db:
    image: postgres:14
    restart: always
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=gitea
      - POSTGRES_DB=gitea
    networks:
      - gitea
    volumes:
      - /data/gitea/db:/var/lib/postgresql/data

As you are using “rootless” the volumes/paths are different in rootless as it uses proper FHS paths (/var/lib/gitea….) rather than the legacy /data paths. So when the container is recreated, the data/config for that instance was contained in the ephemeral paths of the previous container.

1 Like

yup - I had used the “docker compose” instructions :(.. fixed now thanks!

1 Like