# {{ ansible_managed }} version: '3.1' services: gitea: image: gitea/gitea:1.16.5 environment: - USER_UID=1000 - USER_GID=1000 - GITEA__database__DB_TYPE=postgres - GITEA__database__HOST=db:5432 - GITEA__database__NAME={{ docker_gitea_db_name }} - GITEA__database__USER={{ docker_gitea_db_user }} - GITEA__database__PASSWD={{ docker_gitea_db_password }} restart: always volumes: - {{ docker_gitea_data_dir }}/{{ docker_gitea_service_id }}/gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro labels: - "traefik.enable=true" - "traefik.docker.network=traefik" - "traefik.http.routers.{{ docker_gitea_service_id }}.entrypoints=web" - "traefik.http.routers.{{ docker_gitea_service_id }}.rule=Host(`{{ docker_gitea_fqdn }}`)" - "traefik.http.services.{{ docker_gitea_service_id }}.loadbalancer.server.port=3000" ports: - {{ docker_gitea_ssh_port }}:22 networks: - gitea - traefik db: image: postgres:13 restart: always environment: - POSTGRES_DB={{ docker_gitea_db_name }} - POSTGRES_USER={{ docker_gitea_db_user }} - POSTGRES_PASSWORD={{ docker_gitea_db_password }} networks: - gitea volumes: - {{ docker_gitea_data_dir }}/{{ docker_gitea_service_id }}/postgres:/var/lib/postgresql/data networks: traefik: external: true gitea: internal: true