services: # Redis Cache Service redis: image: redis:7-alpine container_name: controles_redis volumes: - redis_data:/data command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru restart: unless-stopped healthcheck: test: [ "CMD", "redis-cli", "ping" ] interval: 30s timeout: 10s retries: 3 networks: - controles_network # Flask Application app: build: . container_name: controles_app ports: - "5000:5000" environment: - FLASK_APP=app.py - FLASK_ENV=production - REDIS_URL=redis://redis:6379/0 - DATABASE_URL=sqlite:////data/database.db # DEV apenas para facilitar testes, não deve ser usado em produção - ADMIN_OTP_SECRET=JBSWY3DPEHPK3PXP # Produção definir em .env #- ADMIN_OTP_SECRET=${ADMIN_OTP_SECRET} volumes: - app_data:/data - app_logs:/app/logs read_only: true tmpfs: - /tmp security_opt: - no-new-privileges:true cap_drop: - ALL depends_on: redis: condition: service_healthy restart: unless-stopped networks: - controles_network networks: controles_network: driver: bridge