Spaces:
Running
Running
File size: 1,394 Bytes
5f4c445 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 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:
|