- Deployed PostgreSQL 18.4 + Gitea 1.22.6 via Docker Compose - Configured Nginx reverse proxy with Let's Encrypt SSL - Created Ansible playbooks for full automation (site.yml) - Database credentials in AWS Secrets Manager - Production deployment at https://gitea.poll-streams.com
87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:18.4
|
|
container_name: gitea-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
POSTGRES_DB: ${DB_NAME}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql
|
|
networks:
|
|
- gitea-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
gitea:
|
|
image: gitea/gitea:1.22.6
|
|
container_name: gitea
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=postgres:5432
|
|
- GITEA__database__NAME=${DB_NAME}
|
|
- GITEA__database__USER=${DB_USER}
|
|
- GITEA__database__PASSWD=${DB_PASSWORD}
|
|
- GITEA__server__DOMAIN=gitea.poll-streams.com
|
|
- GITEA__server__SSH_DOMAIN=gitea.poll-streams.com
|
|
- GITEA__server__ROOT_URL=https://gitea.poll-streams.com
|
|
volumes:
|
|
- gitea-data:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- "3000:3000"
|
|
- "2222:22"
|
|
networks:
|
|
- gitea-network
|
|
|
|
nginx:
|
|
image: nginx:1.27-alpine
|
|
container_name: gitea-nginx
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- gitea
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./nginx/conf.d:/etc/nginx/conf.d:ro
|
|
- certbot-etc:/etc/letsencrypt
|
|
- certbot-var:/var/lib/letsencrypt
|
|
- web-root:/var/www/html
|
|
networks:
|
|
- gitea-network
|
|
|
|
certbot:
|
|
image: certbot/certbot:latest
|
|
container_name: gitea-certbot
|
|
volumes:
|
|
- certbot-etc:/etc/letsencrypt
|
|
- certbot-var:/var/lib/letsencrypt
|
|
- web-root:/var/www/html
|
|
command: certonly --webroot --webroot-path=/var/www/html --email admin@poll-streams.com --agree-tos --no-eff-email --force-renewal -d gitea.poll-streams.com
|
|
depends_on:
|
|
- nginx
|
|
|
|
volumes:
|
|
postgres-data:
|
|
gitea-data:
|
|
certbot-etc:
|
|
certbot-var:
|
|
web-root:
|
|
|
|
networks:
|
|
gitea-network:
|
|
driver: bridge
|