b15754ba2f
- Traefik rate-limits all routes (60 req/min standard, 300 for Nextcloud) and writes access logs to /var/log/traefik/access.log - Fail2ban watches Traefik access logs and bans IPs after 10 x 403/404 within 60 s for 24 h - Nextcloud html directory created as www-data (UID 33) so Apache can process .htaccess and serve requests correctly - scripts/check-services.sh verifies all seven endpoints return the expected HTTP status after provisioning
66 lines
2.0 KiB
Django/Jinja
66 lines
2.0 KiB
Django/Jinja
# Managed by Ansible — do not edit manually
|
|
services:
|
|
gitea:
|
|
image: gitea/gitea:{{ gitea_version }}
|
|
container_name: gitea
|
|
restart: unless-stopped
|
|
environment:
|
|
# Database
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=gitea-db:5432
|
|
- GITEA__database__NAME=gitea
|
|
- GITEA__database__USER=gitea
|
|
- GITEA__database__PASSWD={{ gitea_db_password }}
|
|
# Server
|
|
- GITEA__server__DOMAIN={{ domain_gitea }}
|
|
- GITEA__server__ROOT_URL=https://{{ domain_gitea }}
|
|
- GITEA__server__HTTP_PORT=3000
|
|
- GITEA__server__SSH_DOMAIN={{ domain_gitea }}
|
|
- GITEA__server__SSH_PORT=2222
|
|
# Security
|
|
- GITEA__security__SECRET_KEY={{ gitea_secret_key }}
|
|
- GITEA__security__INTERNAL_TOKEN={{ gitea_internal_token }}
|
|
# Disable public registration — set to false only for initial admin setup
|
|
- GITEA__service__DISABLE_REGISTRATION={{ gitea_disable_registration | lower }}
|
|
volumes:
|
|
- {{ gitea_data_dir }}/data:/data
|
|
ports:
|
|
- "2222:22"
|
|
networks:
|
|
- traefik_public
|
|
- gitea_internal
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.gitea.rule=Host(`{{ domain_gitea }}`)"
|
|
- "traefik.http.routers.gitea.entrypoints=websecure"
|
|
- "traefik.http.routers.gitea.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
|
|
- "traefik.http.routers.gitea.middlewares=rate-limit@docker"
|
|
depends_on:
|
|
gitea-db:
|
|
condition: service_healthy
|
|
|
|
gitea-db:
|
|
image: postgres:{{ gitea_db_version }}
|
|
container_name: gitea-db
|
|
restart: unless-stopped
|
|
environment:
|
|
- POSTGRES_USER=gitea
|
|
- POSTGRES_PASSWORD={{ gitea_db_password }}
|
|
- POSTGRES_DB=gitea
|
|
volumes:
|
|
- {{ gitea_data_dir }}/db:/var/lib/postgresql/data
|
|
networks:
|
|
- gitea_internal
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U gitea"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
networks:
|
|
traefik_public:
|
|
external: true
|
|
gitea_internal:
|
|
internal: true
|