- Add Gitea Actions workflow for automatic deployment - Add production Dockerfile for frontend - Add docker-compose.prod.yml for easy deployment - Zero-downtime deployment with health checks
66 lines
2.0 KiB
YAML
66 lines
2.0 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: pounce-backend
|
|
restart: unless-stopped
|
|
networks:
|
|
- pounce-network
|
|
- supabase-network
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://pounce:PounceDB2024!@supabase-db-n0488s44osgoow4wgo04ogg0:5432/pounce
|
|
- JWT_SECRET=${JWT_SECRET:-pounce-super-secret-jwt-key-2024-production}
|
|
- FRONTEND_URL=http://pounce.185-142-213-170.sslip.io
|
|
- ENVIRONMENT=production
|
|
- ENABLE_SCHEDULER=true
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.pounce-backend.rule=Host(`backend.185-142-213-170.sslip.io`)"
|
|
- "traefik.http.routers.pounce-backend.entryPoints=http"
|
|
- "traefik.http.services.pounce-backend.loadbalancer.server.port=8000"
|
|
- "coolify.managed=true"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- NEXT_PUBLIC_API_URL=http://backend.185-142-213-170.sslip.io
|
|
container_name: pounce-frontend
|
|
restart: unless-stopped
|
|
networks:
|
|
- pounce-network
|
|
environment:
|
|
- NEXT_PUBLIC_API_URL=http://backend.185-142-213-170.sslip.io
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.pounce-frontend.rule=Host(`pounce.185-142-213-170.sslip.io`)"
|
|
- "traefik.http.routers.pounce-frontend.entryPoints=http"
|
|
- "traefik.http.services.pounce-frontend.loadbalancer.server.port=3000"
|
|
- "coolify.managed=true"
|
|
depends_on:
|
|
- backend
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
networks:
|
|
pounce-network:
|
|
name: coolify
|
|
external: true
|
|
supabase-network:
|
|
name: n0488s44osgoow4wgo04ogg0
|
|
external: true
|