# yaml
version: "3.8"

services:
  chores-app-backend: # Production backend service name
    image: git.ryankegel.com:3000/kegel/chores/backend:latest # Or specific version tag
    container_name: chores-app-backend-prod # Added for easy identification
    ports:
      - "${BACKEND_HOST_PORT:-5001}:5000" # Host port -> Container 5000
    environment:
      - FLASK_ENV=production
      - FRONTEND_URL=${FRONTEND_URL}
      - SECRET_KEY=${SECRET_KEY}
      - REFRESH_TOKEN_EXPIRY_DAYS=${REFRESH_TOKEN_EXPIRY_DAYS}
      - DIGEST_TOKEN_SECRET=${DIGEST_TOKEN_SECRET}
      - VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY}
      - VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY}
      - MONGO_URI=${MONGO_URI}
    volumes:
      - chores-app-backend-data:/app/data # Assuming backend data storage; adjust path as needed
    networks:
      - chores-app-net
    # Add other volumes, networks, etc., as needed

  chores-app-frontend: # Production frontend service name
    image: git.ryankegel.com:3000/kegel/chores/frontend:latest # Or specific version tag
    container_name: chores-app-frontend-prod # Added for easy identification
    ports:
      - "${FRONTEND_HOST_PORT:-4601}:${FRONTEND_CONTAINER_PORT:-80}" # Host port -> Container 80 (HTTP; SSL terminated by external proxy)
    environment:
      - BACKEND_HOST=chores-app-backend # Points to internal backend service
      - FRONTEND_SSL_ENABLED=false
    depends_on:
      - chores-app-backend
    networks:
      - chores-app-net
    # Add volumes, networks, etc., as needed

networks:
  chores-app-net:
    driver: bridge

volumes:
  chores-app-backend-data: {}
