| version: '3.8' |
|
|
| services: |
| |
| redis: |
| image: redis:7-alpine |
| ports: |
| - "6379:6379" |
| volumes: |
| - redis_data:/data |
| command: redis-server --appendonly yes |
| healthcheck: |
| test: ["CMD", "redis-cli", "ping"] |
| interval: 10s |
| timeout: 3s |
| retries: 3 |
|
|
| |
| api: |
| build: |
| context: . |
| dockerfile: Dockerfile |
| ports: |
| - "8000:8000" |
| environment: |
| - REDIS_URL=redis://redis:6379 |
| - HANDWRITING_SERVICE_URL=http://handwriting:8080 |
| - PORT=8000 |
| env_file: |
| - api/.env |
| depends_on: |
| - redis |
| command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload |
| working_dir: /app/api |
| volumes: |
| - ./api:/app/api |
| - ./docgenie:/app/docgenie |
|
|
| |
| worker: |
| build: |
| context: . |
| dockerfile: Dockerfile |
| environment: |
| - REDIS_URL=redis://redis:6379 |
| - HANDWRITING_SERVICE_URL=http://handwriting:8080 |
| env_file: |
| - api/.env |
| depends_on: |
| - redis |
| command: rq worker --url redis://redis:6379 |
| working_dir: /app/api |
| volumes: |
| - ./api:/app/api |
| - ./docgenie:/app/docgenie |
|
|
| |
| |
| handwriting: |
| build: |
| context: handwriting_service |
| dockerfile: Dockerfile |
| ports: |
| - "8080:8080" |
| environment: |
| - DEVICE=cuda |
| deploy: |
| resources: |
| reservations: |
| devices: |
| - driver: nvidia |
| count: 1 |
| capabilities: [gpu] |
| volumes: |
| - ./handwriting_service:/app |
| - ./WordStylist:/app/WordStylist |
|
|
| volumes: |
| redis_data: |
|
|