File size: 1,665 Bytes
a0098d0 |
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# Docker Compose for local development with GPU support
services:
# Full application (frontend + backend)
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "7860:7860"
environment:
- CUDA_VISIBLE_DEVICES=0
volumes:
- ./models:/app/models
- ./cache:/app/cache
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
restart: unless-stopped
# Development mode: separate frontend and backend
backend-dev:
build:
context: .
dockerfile: Dockerfile
target: python-base
command: python -m uvicorn backend.api.main:app --host 0.0.0.0 --port 8000 --reload
ports:
- "8000:8000"
volumes:
- ./backend:/app/backend
- ./models:/app/models
environment:
- CUDA_VISIBLE_DEVICES=0
profiles:
- dev
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
frontend-dev:
image: node:20-alpine
working_dir: /app
command: sh -c "npm install && npm run dev -- --host"
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- VITE_API_URL=http://localhost:8000/api
profiles:
- dev
# CPU-only version (no GPU)
app-cpu:
build:
context: .
dockerfile: Dockerfile
ports:
- "7860:7860"
volumes:
- ./models:/app/models
profiles:
- cpu
restart: unless-stopped
networks:
default:
name: quantizer-network
|