
services:
  strapi:
    build:
      context: .
      dockerfile: Dockerfile
      target: production
    container_name: ambassador-cms
    restart: unless-stopped
    env_file: .env
    environment:
      NODE_ENV: production
      DATABASE_CLIENT: sqlite
      DATABASE_FILENAME: .tmp/data.db
    ports:
      - "${PORT:-9002}:9002"
    volumes:
      - ./public/uploads:/app/public/uploads
      - ./.tmp:/app/.tmp
    healthcheck:
      test: ["CMD", "curl", "-f", "http://0.0.0.0:9002/_health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 60s
    networks:
      - strapi-network
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 2G
        reservations:
          cpus: '0.5'
          memory: 512M

networks:
  strapi-network:
    driver: bridge
