-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
67 lines (62 loc) · 2.14 KB
/
docker-compose.yml
File metadata and controls
67 lines (62 loc) · 2.14 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
# mentioned all services
services:
# installing redis from image and its become container
redis:
# pulling the redis 7 image from docker hub
image: redis:7
# mapping the port 6379 of the container to port 6380 of the host machine
ports:
- "6380:6379"
# container-name
container_name: python_celery_tutorial_redis
# our fast-api application code container
api:
# building the image from the given application-code
build: .
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
# mapping the port 8000 of the container to port 8000 of the host machine
ports:
- "8000:8000"
# once redis is installed then only api will be built and run
depends_on:
redis:
# redis service should be started before starting the api service
condition: service_started
# container-name
container_name: python_celery_tutorial_api
# environment variable
environment:
- REDIS_HOST=python_celery_tutorial_redis
- REDIS_PORT=6379
# celery worker-process container
worker:
# building the image from given application-code
build: .
command: celery -A app.celery_app worker -Q default -l info --loglevel=info -E
# once redis is installed then only worker will be built and run
depends_on:
redis:
# redis service should be started before starting the api service
condition: service_started
# container-name
container_name: python_celery_tutorial_celeryworker
# environment variable
environment:
- REDIS_HOST=python_celery_tutorial_redis
- REDIS_PORT=6379
# celery beat-worker process container
beat:
# building the image from given application-code
build: .
command: celery -A app.celery_app beat --loglevel=info
# once redis is installed then only beat will be built and run
depends_on:
redis:
# redis service should be started before starting the api service
condition: service_started
# container-name
container_name: python_celery_tutorial_celerybeat
# environment variable
environment:
- REDIS_HOST=python_celery_tutorial_redis
- REDIS_PORT=6379