diff --git a/gitea/gitea-stack.yaml b/gitea/gitea-stack.yaml new file mode 100644 index 0000000..38b09c0 --- /dev/null +++ b/gitea/gitea-stack.yaml @@ -0,0 +1,57 @@ +services: + server: + image: gitea/gitea:latest + environment: + - USER_UID=1000 + - USER_GID=1000 + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=db:5432 + - GITEA__database__NAME=gitea + - GITEA__database__USER=automacao + - GITEA__database__PASSWD_FILE=/run/secrets/postgres16 + # + # Foi necessário desabilitar o auto-registro dentro do próprio Gitea + # Analisar o motivo de as variáveis não terem surtido efeito + # + #- GITEA__registration__ENABLED=false + #- GITEA__registration__APPROVAL=true + #- GITEA__registration__ENABLE_CAPTCHA=true + secrets: + - postgres16 + networks: + - postgres_network + volumes: + - gitea_data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3458:3000" + - "2226:22" + deploy: + mode: replicated + replicas: 1 + resources: + limits: + cpus: "0.5" + memory: "512M" + update_config: + parallelism: 1 + delay: 10s + rollback_config: + parallelism: 1 + monitor: 30s + +networks: + postgres_network: + driver: overlay + attachable: true + external: true + +volumes: + gitea_data: + external: true + +secrets: + postgres16: + external: true +