version: "3.8"

services:
  web:
    build: .
    ports:
      - "54321:5000"
    volumes:
      - ./static/uploads:/app/static/uploads
      - ./pet_pictures.db:/app/pet_pictures.db
    environment:
      - FLASK_APP=main.py
      - FLASK_ENV=production
      - GUNICORN_CMD_ARGS=--workers=4 --bind=0.0.0.0:5000 --timeout=120
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
