-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
25 lines (24 loc) · 960 Bytes
/
docker-compose.yaml
File metadata and controls
25 lines (24 loc) · 960 Bytes
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
version: "3.8"
services:
nvidia-endpoint:
build: .
working_dir: /app
# Run FastAPI via uvicorn, listening on all interfaces
command: >
python3 -m uvicorn nvidia_endpoint:app
--host 0.0.0.0 --port 5050 --workers 1
ports:
- "5051:5050" # host:container
volumes:
# Map your script into the container under a valid module name
- ./nvidia-endpoint-server.py:/app/nvidia_endpoint.py:ro
# (Optional) map requirements if you iterate frequently:
# - ./requirements.txt:/app/requirements.txt:ro
# Minimal, simple runtime—add your key only if you want auth on /nvidia/
environment:
# NVIDIA_API_KEY: "change-me" # uncomment to require X-API-Key
restart: unless-stopped
# Modern GPU exposure in Compose v2 (no deprecated 'runtime: nvidia')
# If you target multiple GPUs, change gpus to - "all" or list devices, e.g. "device=0,1".
gpus:
- "device=0"