Spaces:
Runtime error
Runtime error
services: | |
# Unified service - works for both development and production | |
translations: | |
platform: "linux/amd64" | |
container_name: translations_api | |
build: | |
context: . | |
# Enable GPU access | |
deploy: | |
resources: | |
reservations: | |
devices: | |
- driver: nvidia | |
count: 1 | |
capabilities: [gpu] | |
ports: | |
- 7860:7860 | |
- 5679:5678 # debugpy port for development | |
# Mount both code and models (code mount enables live editing in dev) | |
volumes: | |
- type: bind | |
source: ./server/ | |
target: /home/user/app/server/ | |
- type: bind | |
source: ./server/models/ | |
target: /home/user/app/models/ | |
environment: | |
- AWS_ACCESS_KEY_ID | |
- AWS_SECRET_ACCESS_KEY | |
- AWS_SESSION_TOKEN | |
- API_LOG_LEVEL=DEBUG # Can be overridden for production | |
- CUDA_VISIBLE_DEVICES=0 | |
- NVIDIA_VISIBLE_DEVICES=all | |
- NVIDIA_DRIVER_CAPABILITIES=compute,utility | |
# Default to production mode (can be overridden) | |
# For development: docker-compose run translations bash ./run_dev.sh | |
# For production: docker-compose up translations (uses default CMD) | |
# Test service | |
test: | |
platform: "linux/amd64" | |
container_name: translations_test | |
build: | |
context: . | |
volumes: | |
- type: bind | |
source: ./server/ | |
target: /home/user/app/server/ | |
- type: bind | |
source: ./server/models/ | |
target: /home/user/app/models/ | |
working_dir: /home/user/app | |
environment: | |
- PYTHONPATH=/home/user/app | |
- AWS_ACCESS_KEY_ID | |
- AWS_SECRET_ACCESS_KEY | |
- AWS_SESSION_TOKEN | |
command: | |
[ | |
"conda", | |
"run", | |
"--no-capture-output", | |
"-n", | |
"translations-api", | |
"bash", | |
"/home/user/app/server/run_tests.sh", | |
] | |