version: '3.8'

services:
  # The Flask Backend API
  api:
    build: ./backend
    container_name: flask_api
    restart: always
    ports:
      - "5000:5000"
    environment:
      - SECRET_KEY=${SECRET_KEY:-your_secret_key_here}
      - GOOGLE_API_KEY=${GOOGLE_API_KEY}
      - MONGO_URI=${MONGO_URI}
      - OLLAMA_HOST=${OLLAMA_HOST:-https://ollama.sirblob.co}
      - ATLAS_VECTORS=${ATLAS_VECTORS:-false}
    networks:
      - ethix-network

  # The Frontend Server with API Proxy
  frontend:
    build: ./frontend
    container_name: svelte_frontend
    restart: always
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - API_URL=http://api:5000
    depends_on:
      - api
    networks:
      - ethix-network

networks:
  ethix-network:
    driver: bridge
