version: '3.8'

services:
  app:
    image: gpfx-app:latest
    build: .
    ports:
      - "5000:5000"
    volumes:
      - logs:/app/logs
      - reports:/app/reports
    environment:
      - FLASK_ENV=production
      - FLASK_APP=src/app.py
    deploy:
      mode: replicated
      replicas: 3
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
      resources:
        limits:
          cpus: '0.5'
          memory: 512M

volumes:
  logs:
  reports: 