-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (95 loc) · 2.58 KB
/
docker-compose.yml
File metadata and controls
102 lines (95 loc) · 2.58 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
networks:
imageinf-network:
volumes:
huggingface-cache: # Named volume for persistence
services:
# One-off service to preload models
model-preloader:
image: taccwma/imageinf:local
container_name: imageinf_preloader
volumes:
- huggingface-cache:/root/.cache/huggingface
- .:/app
networks:
- imageinf-network
environment:
- PYTHONUNBUFFERED=1 # Unbuffered output
- HF_HUB_DISABLE_PROGRESS_BARS=0 # Enable progress bars
command: python -u preload_models.py
profiles:
- setup
imageinf:
image: taccwma/imageinf:local
container_name: imageinf_service
depends_on:
rabbitmq:
condition: service_healthy
redis:
condition: service_started
environment:
- LOG_LEVEL=DEBUG
- PYTHONUNBUFFERED=1
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
volumes:
- .:/app
- /app/.venv # preserve venv from image
- huggingface-cache:/root/.cache/huggingface # Share the cache
networks:
- imageinf-network
command: uvicorn imageinf.main:app --host 0.0.0.0 --port 8000 --reload
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: imageinf_rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 5s
retries: 5
networks:
- imageinf-network
redis:
image: redis:7-alpine
container_name: imageinf_redis
networks:
- imageinf-network
celery-worker:
image: taccwma/imageinf:local
container_name: imageinf_celery_worker
volumes:
- .:/app
- /app/.venv # preserve venv from image
- huggingface-cache:/root/.cache/huggingface
environment:
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
- LOG_LEVEL=DEBUG
- PYTHONUNBUFFERED=1
depends_on:
rabbitmq:
condition: service_healthy
redis:
condition: service_started
networks:
- imageinf-network
command: celery -A imageinf.celery_app worker --loglevel=debug
nginx:
image: nginx:alpine
container_name: imageinf_nginx
ports:
- "8080:80"
volumes:
- ./local_conf/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
imageinf:
condition: service_started
rabbitmq:
condition: service_healthy
networks:
- imageinf-network