services:
  api:
    build:
      context: ./api
      dockerfile: dockerfile
    ports:
      - "${API_PORT:-4646}:4646"
    env_file:
      - ./api/.env
    environment:
      NODE_ENV: production
      PORT: 4646
      FRONTEND_URL: ${FRONTEND_URL:-http://localhost:8181}
    volumes:
      - api-uploads:/app/build/public/uploads
    restart: unless-stopped

  web:
    build:
      context: ./web
      dockerfile: Dockerfile
      args:
        VITE_API_URL: ${VITE_API_URL:-http://localhost:4646}
    ports:
      - "${WEB_PORT:-8181}:80"
    depends_on:
      - api
    restart: unless-stopped

volumes:
  api-uploads:
