version: '3.4' services: app: image: "{{ stack_image }}:{{ gitea_version }}" healthcheck: test: ["CMD", "wget", "--spider", "-q", "localhost:3000"] interval: 1m timeout: 10s retries: 3 start_period: 1m volumes: - data:/data - /home/git/.ssh:/data/git/.ssh - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro environment: - USER_UID={{ git_user['uid'] }} - USER_GID={{ git_user['group'] }} - GITEA__database__DB_TYPE=postgres - GITEA__database__HOST=db:5432 - GITEA__database__NAME={{ gitea_db_database }} - GITEA__database__USER={{ gitea_db_username }} - GITEA__database__PASSWD={{ gitea_db_password }} - "GITEA__server__ROOT_URL={{ (gitea_use_https == True) | ternary('https', 'http') }}://{{ (subdomain_alias is not undefined and not none) | ternary(subdomain_alias, stack_name) }}.{{server_domain}}" - "GITEA__server__SSH_DOMAIN={{ server_domain }}" - GITEA__server__LANDINGPAGE=explore - GITEA__service__DISABLE_REGISTRATION=true {% if gitea_app_admin_username is not undefined and not None and gitea_app_admin_password is not undefined and not None %} - GITEA__security__INSTALL_LOCK=true {% endif %} {% if gitea_smtp_host is not undefined and not None and gitea_smtp_username is not undefined and not None and gitea_smtp_password is not undefined and not None %} - GITEA__mailer__ENABLED=true - GITEA__service__ENABLE_NOTIFY_MAIL=true - GITEA__mailer__FROM=gitea@{{ server_domain }} - GITEA__mailer__TYPE=smtp - GITEA__mailer__HOST={{ gitea_smtp_host }} - GITEA__mailer__IS_TLS_ENABLED={{ (gitea_smtp_force_tls is not undefined and not None) | ternary(gitea_smtp_force_tls,'false') }} - GITEA__mailer__USER={{ gitea_smtp_username }} - GITEA__mailer__PASSWD={{ gitea_smtp_password }} {% endif %} networks: - "{{ docker_swarm_public_network_name }}" - backend ports: - "127.0.0.1:2222:22" db: image: postgres:13 volumes: - db:/var/lib/postgresql/data networks: - backend environment: - POSTGRES_USER={{ gitea_db_username }} - POSTGRES_PASSWORD={{ gitea_db_password }} - POSTGRES_DB={{ gitea_db_database }} volumes: data: db: networks: "{{ docker_swarm_public_network_name }}": external: true backend: