Files
ThreatHunt/docker-compose.prod.yml

73 lines
1.3 KiB
YAML

version: '3.8'
services:
database:
image: postgres:15
environment:
POSTGRES_DB: threat_hunter
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backups:/backups
restart: unless-stopped
networks:
- internal
backend:
build:
context: ./backend
dockerfile: Dockerfile.prod
environment:
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@database:5432/threat_hunter
SECRET_KEY: ${SECRET_KEY}
FLASK_ENV: production
depends_on:
- database
volumes:
- ./uploads:/app/uploads
- ./logs:/app/logs
restart: unless-stopped
networks:
- internal
- web
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
ports:
- "80:80"
- "443:443"
volumes:
- ./ssl:/etc/ssl/certs
depends_on:
- backend
restart: unless-stopped
networks:
- web
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./ssl:/etc/ssl/certs
depends_on:
- frontend
- backend
restart: unless-stopped
networks:
- web
volumes:
postgres_data:
networks:
web:
external: true
internal:
internal: true