gitea/compose.yml

113 lines
3.0 KiB
YAML
Raw Normal View History

2020-06-17 06:21:19 +00:00
---
version: "3.8"
services:
2020-10-27 10:25:48 +00:00
app:
image: "gitea/gitea:1.13.2"
2020-06-17 06:21:19 +00:00
configs:
- source: app_ini
target: /data/gitea/conf/app.ini
secrets:
- db_passwd
- internal_token
- jwt_secret
- secret_key
2020-10-27 10:25:48 +00:00
- smtp_passwd
2020-06-17 06:21:19 +00:00
environment:
2020-10-27 10:25:48 +00:00
- GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION
- GITEA_APP_NAME
- GITEA_AUTO_WATCH_NEW_REPOS
2020-10-27 10:36:05 +00:00
- GITEA_DB_HOST="db:3306"
2020-10-27 10:25:48 +00:00
- GITEA_DB_NAME=gitea
- GITEA_DB_TYPE=mysql
- GITEA_DB_USER=gitea
- GITEA_DISABLE_REGISTRATION
2020-06-17 06:21:19 +00:00
- GITEA_DOMAIN=${DOMAIN}
2020-10-27 10:25:48 +00:00
- GITEA_ENABLE_NOTIFY_MAIL
- GITEA_ENABLE_OPENID_SIGNIN
- GITEA_ENABLE_OPENID_SIGNUP
- GITEA_MAILER_FROM
- GITEA_MAILER_HOST
- GITEA_MAILER_USER
- GITEA_SSH_PORT
2020-06-17 06:21:19 +00:00
volumes:
- "git:/data"
2020-10-27 10:25:48 +00:00
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
2020-06-17 06:21:19 +00:00
networks:
- proxy
- internal
2020-06-22 17:41:06 +00:00
healthcheck:
2020-07-01 08:00:29 +00:00
test: ["CMD", "curl", "-f", "http://localhost:3000"]
2020-06-22 17:41:06 +00:00
interval: 15s
timeout: 10s
retries: 10
2020-10-27 10:25:48 +00:00
start_period: 30s
2020-06-17 06:21:19 +00:00
deploy:
update_config:
failure_action: rollback
2020-06-22 17:41:06 +00:00
order: start-first
2020-06-17 06:21:19 +00:00
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitea.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.gitea.entrypoints=web-secure"
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
2020-10-27 10:25:48 +00:00
- "traefik.http.routers.gitea.tls.certresolver=${LETS_ENCRYPT_ENV}"
2020-06-17 06:21:19 +00:00
- "traefik.tcp.routers.gitea-ssh.rule=HostSNI(`*`)"
- "traefik.tcp.routers.gitea-ssh.entrypoints=gitea-ssh"
2020-10-27 10:25:48 +00:00
- "traefik.tcp.services.gitea-ssh.loadbalancer.server.port=${GITEA_SSH_PORT}"
2020-06-17 06:21:19 +00:00
2020-10-27 10:32:00 +00:00
db:
2020-06-23 09:10:33 +00:00
image: "mariadb:10.5"
command: |
mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
2020-06-23 09:10:33 +00:00
environment:
- MYSQL_DATABASE=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD_FILE=/run/secrets/db_passwd
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_passwd
2020-06-17 06:21:19 +00:00
secrets:
- db_passwd
2020-06-23 09:10:33 +00:00
- db_root_passwd
volumes:
- "mariadb:/var/lib/mysql"
2020-06-17 06:21:19 +00:00
networks:
- internal
networks:
internal:
proxy:
external: true
configs:
app_ini:
2020-10-27 10:25:48 +00:00
name: ${STACK_NAME}_app_ini_${APP_INI_VERSION}
2020-06-17 06:21:19 +00:00
file: app.ini.tmpl
template_driver: golang
# Note(decentral1se): migrate from passwd -> password
# See https://git.autonomic.zone/coop-cloud/abra/pulls/33
2020-06-17 06:21:19 +00:00
secrets:
db_passwd:
name: ${STACK_NAME}_db_passwd_${SECRET_DB_PASSWORD_VERSION}
2020-06-17 06:21:19 +00:00
external: true
2020-06-23 09:39:51 +00:00
db_root_passwd:
name: ${STACK_NAME}_db_root_passwd_${SECRET_DB_ROOT_PASSWORD_VERSION}
2020-06-23 09:39:51 +00:00
external: true
2020-06-17 06:21:19 +00:00
internal_token:
name: ${STACK_NAME}_internal_token_${SECRET_INTERNAL_TOKEN_VERSION}
2020-06-17 06:21:19 +00:00
external: true
jwt_secret:
name: ${STACK_NAME}_jwt_secret_${SECRET_JWT_SECRET_VERSION}
2020-06-17 06:21:19 +00:00
external: true
secret_key:
name: ${STACK_NAME}_secret_key_${SECRET_SECRET_KEY_VERSION}
2020-10-27 10:25:48 +00:00
external: true
smtp_passwd:
name: ${STACK_NAME}_smtp_passwd_${SECRET_SMTP_PASSWORD_VERSION}
2020-06-17 06:21:19 +00:00
external: true
volumes:
git:
2020-06-23 09:10:33 +00:00
mariadb: