version: '3.8'

services:
  linkedin-posts:
    build: .
    container_name: linkedin-posts
    restart: unless-stopped
    ports:
      - "8001:8001"
    env_file:
      - .env
    environment:
      - PYTHONPATH=/app
      - PORT=8001
    volumes:
      # Optional: Mount logs directory
      - ./logs:/app/logs
    healthcheck:
      test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:8001/login', timeout=5)"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

  # Optional: Nginx reverse proxy with SSL
  # Uncomment if you want to use Nginx
  # nginx:
  #   image: nginx:alpine
  #   container_name: linkedin-posts-nginx
  #   restart: unless-stopped
  #   ports:
  #     - "80:80"
  #     - "443:443"
  #   volumes:
  #     - ./nginx.conf:/etc/nginx/nginx.conf:ro
  #     - ./ssl:/etc/nginx/ssl:ro
  #   depends_on:
  #     - linkedin-posts
