-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (80 loc) · 2.18 KB
/
docker-compose.yml
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
version: '3.9'
x-default-healthcheck-timings: &default-healthcheck-timings
interval: 3m
timeout: 3m
retries: 3
start_period: 30s
x-default-user-args: &default-user-args
args:
- USER=${UID}
- GROUP=${GID}
services:
app:
hostname: app
build:
context: ./app
<<: *default-user-args
env_file: .env
volumes:
- ${BM_API_DATA}:/home/user/app/data
command: uvicorn main:app --host 0.0.0.0 --port ${BACKEND_PORT}
healthcheck:
test: curl -f http://0.0.0.0:8000/healthcheck || exit 1
<<: *default-healthcheck-timings
ports:
- ${BACKEND_PORT}:${BACKEND_PORT}
restart: always
rabbitmq:
hostname: ${RABBITMQ_HOSTNAME}
image: rabbitmq:3.8
volumes:
- ${BM_RABBITMQ:-./rabbitmq}/config/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
- ${BM_RABBITMQ:-./rabbitmq}/data:/var/lib/rabbitmq/
- ${BM_RABBITMQ:-./rabbitmq}/log:/var/log/rabbitmq
restart: always
redis:
hostname: ${REDIS_HOSTNAME}
image: redis:6-alpine
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- ${BM_REDIS:-./redis}/data:/data
restart: always
worker:
hostname: worker
build:
context: ./worker
target: production
<<: *default-user-args
env_file: .env
command: >
celery worker
-c ${CELERY_NUM_WORKERS}
-A celery_app.celery_app
--loglevel=info
--logfile=./logs/celery.log
volumes:
- ${BM_RASTER_SOURCE1:-./sar}:/home/user/worker/volumes/sar/source1
- ${BM_ICEMAP_SOURCE1:-./icemap}:/home/user/worker/volumes/icemap/source1
- ${BM_LAND:-./land}:/home/user/worker/land
- ${BM_OUTPUT:-./output}:/home/user/worker/output
depends_on:
- rabbitmq
- redis
restart: always
monitor:
build:
context: ./worker
target: production
<<: *default-user-args
ports:
- ${FLOWER_PORT}:${FLOWER_PORT}
command: >
flower
-A celery_app.celery_app
--port=$FLOWER_PORT
--broker=amqp://$RABBITMQ_USERNAME:$RABBITMQ_PASSWORD@$RABBITMQ_HOSTNAME:$RABBITMQ_NODE_PORT_NUMBER//
env_file: .env
depends_on:
- redis
- rabbitmq
restart: always