version: '3.8'
services:
  services-homepage:
    build: .
    container_name: services-homepage
    ports:
      - "8088:80"
    volumes:
      - ./services.xml:/usr/share/nginx/html/services.xml:ro
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-size: "5m"
        max-file: "2"

  health-proxy:
    image: python:3.10-slim
    container_name: services-homepage-health-proxy
    working_dir: /app
    volumes:
      - ./backend/health-proxy.py:/app/health-proxy.py:ro
      - ./services.xml:/usr/share/nginx/html/services.xml:ro
    environment:
      - HEALTH_TOKEN=
    command: ["sh", "-c", "pip install flask requests && python health-proxy.py"]
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-size: "5m"
        max-file: "2"

  order-service:
    image: python:3.10-slim
    container_name: services-homepage-order-service
    working_dir: /app
    volumes:
      - ./backend/order-service.py:/app/order-service.py:ro
      - order-data:/data
    command: ["sh", "-c", "pip install flask && python order-service.py"]
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-size: "5m"
        max-file: "2"

volumes:
  order-data:
