Spaces:
Sleeping
Sleeping
| #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# | |
| # Run as follows from root: | |
| # >>> docker compose --env-file .env -f docker/docker-compose.yml up --build | |
| #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# | |
| services: | |
| # --- Database Service --- | |
| # Runs a PostgreSQL 15 instance with persistent storage. | |
| db: | |
| image: postgres:15 | |
| container_name: agentic_hr_db | |
| restart: always | |
| ports: | |
| - "5433:5432" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U agentic_user -d agentic_hr"] | |
| interval: 3s | |
| timeout: 3s | |
| retries: 5 | |
| # Hey compose here is env file, | |
| # pass it to container, but not the .env itself | |
| env_file: | |
| - ../.env | |
| environment: | |
| POSTGRES_HOST: ${POSTGRES_HOST} | |
| POSTGRES_PORT: ${POSTGRES_PORT} | |
| POSTGRES_USER: ${POSTGRES_USER} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
| POSTGRES_DB: ${POSTGRES_DB} | |
| networks: | |
| - hrnet | |
| candidates_db_init: | |
| # --- Application Service --- | |
| # Runs your Python backend inside Docker. | |
| # Initializes the database or starts the API (depending on command). | |
| container_name: candidates_db_init | |
| build: | |
| context: .. # build from the project root | |
| dockerfile: docker/Dockerfile.candidates_db_init | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| # Hey compose here is env file, | |
| # pass it to container, but not the .env itself | |
| env_file: | |
| - ../.env | |
| environment: | |
| # Explicitly set POSTGRES_HOST to the service name 'db' for Docker networking | |
| POSTGRES_HOST: db | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: ${POSTGRES_USER} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
| POSTGRES_DB: ${POSTGRES_DB} | |
| command: ["python", "-m", "src.backend.database.candidates.init_db"] | |
| volumes: | |
| # --- Local code mount (for development only) --- | |
| # Mounts your entire project source from the host (../) | |
| # into the container at /app. | |
| # ✅ Enables live code changes without rebuilding the image. | |
| # ⚠️ Do NOT use in production – overrides the built image code. | |
| - ../:/app # optional: live reload for local dev | |
| networks: | |
| - hrnet | |
| # --- CV Upload --- | |
| cv_upload_streamlit: | |
| container_name: cv_upload_streamlit | |
| build: | |
| context: .. | |
| dockerfile: docker/Dockerfile.cv_upload | |
| ports: | |
| - "8501:8501" | |
| depends_on: | |
| - db | |
| - supervisor_api | |
| env_file: | |
| - ../.env | |
| environment: | |
| # Database connection | |
| POSTGRES_HOST: db | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: ${POSTGRES_USER} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
| POSTGRES_DB: ${POSTGRES_DB} | |
| DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} | |
| CV_UPLOAD_PATH: /app/src/backend/database/cvs/uploads | |
| # App specific | |
| CV_UPLOAD_API_URL: http://supervisor_api:8080/api/v1/cv | |
| PYTHONPATH: /app | |
| volumes: | |
| # Mount local code for live updates | |
| - ../:/app | |
| # Shared volume for CV uploads (persistent) | |
| - ../src/backend/database/cvs:/app/src/backend/database/cvs | |
| command: ["streamlit", "run", "src/frontend/streamlit/cv_ui/app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |
| networks: | |
| - hrnet | |
| # --- WebSocket Proxy for OpenAI Realtime API --- | |
| websocket_proxy: | |
| container_name: websocket_proxy | |
| build: | |
| context: .. | |
| dockerfile: docker/Dockerfile.voice_proxy | |
| ports: | |
| - "8000:8000" | |
| env_file: | |
| - ../.env | |
| depends_on: | |
| - db | |
| - candidates_db_init | |
| environment: | |
| PYTHONPATH: /app | |
| OPENAI_API_KEY: ${OPENAI_API_KEY} | |
| BACKEND_API_URL: http://supervisor_api:8080 | |
| # Database connection | |
| POSTGRES_HOST: db | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: ${POSTGRES_USER} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
| POSTGRES_DB: ${POSTGRES_DB} | |
| volumes: | |
| # Mount local code for live updates | |
| - ../:/app | |
| command: ["python", "-m", "uvicorn", "src.frontend.streamlit.voice_screening_ui.proxy:app", "--host", "0.0.0.0", "--port", "8000"] | |
| networks: | |
| - hrnet | |
| # --- Voice Screening UI --- | |
| voice_screening_ui: | |
| container_name: voice_screening_ui | |
| build: | |
| context: .. | |
| dockerfile: docker/Dockerfile.voice_screening | |
| ports: | |
| - "8502:8501" # Map host port 8502 to container port 8501 | |
| depends_on: | |
| - db | |
| - websocket_proxy | |
| env_file: | |
| - ../.env | |
| environment: | |
| DATABASE_URL: postgresql://agentic_user:password123@db:5432/agentic_hr | |
| PYTHONPATH: /app | |
| WEBSOCKET_PROXY_URL: ws://websocket_proxy:8000/ws/realtime | |
| BACKEND_API_URL: http://supervisor_api:8080 | |
| volumes: | |
| # Mount local code for live updates | |
| - ../:/app | |
| command: ["streamlit", "run", "src/frontend/streamlit/voice_screening_ui/app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |
| networks: | |
| - hrnet | |
| # --- Supervisor Agent API --- | |
| supervisor_api: | |
| container_name: supervisor_api | |
| build: | |
| context: .. | |
| dockerfile: docker/Dockerfile.supervisor_api | |
| ports: | |
| - "8080:8080" # Map host port 8080 to container port 8080 | |
| depends_on: | |
| - db | |
| env_file: | |
| - ../.env | |
| environment: | |
| # We set POSTGRES_HOST to 'db' so the agent connects to the container internal network | |
| POSTGRES_HOST: db | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: ${POSTGRES_USER} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
| POSTGRES_DB: ${POSTGRES_DB} | |
| PYTHONPATH: /app | |
| PROMPTLAYER_API_KEY: ${PROMPTLAYER_API_KEY} | |
| OPENAI_API_KEY: ${OPENAI_API_KEY} | |
| WEBSOCKET_PROXY_URL: ws://websocket_proxy:8000/ws/realtime | |
| CV_UPLOAD_PATH: /app/src/backend/database/cvs/uploads | |
| CV_PARSED_PATH: /app/src/backend/database/cvs/parsed | |
| volumes: | |
| # Mount local code for live updates | |
| - ../:/app | |
| command: ["uvicorn", "src.backend.api.app:app", "--host", "0.0.0.0", "--port", "8080", "--reload"] | |
| networks: | |
| - hrnet | |
| # --- Supervisor Agent UI --- | |
| supervisor_ui: | |
| container_name: supervisor_ui | |
| build: | |
| context: .. | |
| dockerfile: docker/Dockerfile.supervisor | |
| ports: | |
| - "8503:8501" # Map host port 8503 to container port 8501 | |
| depends_on: | |
| - db | |
| - supervisor_api | |
| env_file: | |
| - ../.env | |
| environment: | |
| # We set POSTGRES_HOST to 'db' so the agent connects to the container internal network | |
| PYTHONPATH: /app | |
| # API URL for the Streamlit UI to connect to | |
| SUPERVISOR_API_URL: http://supervisor_api:8080/api/v1/supervisor | |
| volumes: | |
| # Mount local code for live updates | |
| - ../:/app | |
| command: | |
| [ | |
| "streamlit", | |
| "run", | |
| "src/frontend/streamlit/supervisor_ui/app.py", | |
| "--server.port=8501", | |
| "--server.address=0.0.0.0", | |
| ] | |
| networks: | |
| - hrnet | |
| volumes: | |
| postgres_data: | |
| cvs_data: | |
| driver: local | |
| networks: | |
| hrnet: | |
| driver: bridge | |