netviz/docker-compose.yml
2025-03-25 23:41:13 +01:00

60 lines
1.4 KiB
YAML

version: '3.8'
services:
web:
build: .
restart: always
ports:
- "5000:5000"
depends_on:
- db
- redis
environment:
- FLASK_APP=app
- FLASK_ENV=production
- DATABASE_URL=postgresql://netviz:netviz_password@db:5432/netviz
- SECRET_KEY=${SECRET_KEY:-change_this_to_a_secure_random_string}
- SECURITY_PASSWORD_SALT=${SECURITY_PASSWORD_SALT:-change_this_too}
- SESSION_TYPE=redis
- SESSION_REDIS=redis://redis:6379/0
- RATELIMIT_STORAGE_URL=redis://redis:6379/1
- SECURE_HEADERS_ENABLED=True
volumes:
- ./app:/app/app
- ./migrations:/app/migrations
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:5000/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:14-alpine
restart: always
environment:
- POSTGRES_USER=netviz
- POSTGRES_PASSWORD=netviz_password
- POSTGRES_DB=netviz
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U netviz" ]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:6-alpine
restart: always
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
redis_data: