Spaces:
Running
Running
| version: "3.9" | |
| services: | |
| shopbot-api: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: shopbot-api | |
| ports: | |
| - "8000:8000" | |
| environment: | |
| # ββ Required: Set your NVIDIA API key ββββββββββββββββββββββββββββββββββ | |
| - NVIDIA_API_KEY=${NVIDIA_API_KEY} | |
| # ββ PHP DB layer URL (update to your PHP server's address) βββββββββββββ | |
| # If your PHP server runs on the host machine, use host.docker.internal | |
| # Example: http://host.docker.internal/api_ct/db_api.php | |
| - PHP_DB_URL=${PHP_DB_URL:-http://host.docker.internal/api_ct/db_api.php} | |
| # ββ Internal secret shared between this API and your PHP layer βββββββββ | |
| - INTERNAL_SECRET=${INTERNAL_SECRET:-change_this_secret_in_production} | |
| volumes: | |
| # Persist SQL query result files outside the container | |
| - sql_results:/app/sql_results | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 15s | |
| extra_hosts: | |
| # Allows the container to reach services on your host machine | |
| - "host.docker.internal:host-gateway" | |
| volumes: | |
| sql_results: | |