version: '3.8'

services:
  hoof-scan:
    build: .
    container_name: hoof-scan-swiss-galloppers
    ports:
      - "5000:5000"
    environment:
      - NODE_ENV=production
      - DATABASE_URL=${DATABASE_URL}
      - JWT_SECRET=${JWT_SECRET}
      - OPENWEATHER_API_KEY=${OPENWEATHER_API_KEY}
      - SENDGRID_API_KEY=${SENDGRID_API_KEY}
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    networks:
      - hoof-scan-network

  nginx:
    image: nginx:alpine
    container_name: hoof-scan-nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./ssl:/etc/nginx/ssl:ro
    depends_on:
      - hoof-scan
    restart: unless-stopped
    networks:
      - hoof-scan-network

networks:
  hoof-scan-network:
    driver: bridge

volumes:
  hoof-scan-data: