-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
104 lines (99 loc) · 2.72 KB
/
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
version: '3'
services:
db:
image: postgres:15
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
restart: always
backend:
build:
context: backend
dockerfile: Dockerfile
command: flask run
stop_signal: SIGINT
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
CELERY_TASK_SERIALIZER: ${CELERY_TASK_SERIALIZER}
CELERY_RESULT_SERIALIZER: ${CELERY_RESULT_SERIALIZER}
CELERY_ACCEPT_CONTENT: ${CELERY_ACCEPT_CONTENT}
restart: always
volumes:
- type: bind
source: ./backend
target: /app
depends_on:
- db
- redis
proxy:
image: nginx:alpine
volumes:
- type: bind
source: ./proxy/nginx.conf
target: /etc/nginx/conf.d/default.conf
read_only: true
ports:
- "80:80"
depends_on:
- backend
redis:
image: redis:alpine
ports:
- "6379:6379"
restart: always
celery-worker:
build:
context: backend
dockerfile: Dockerfile
command: celery -A app worker --loglevel=info
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
CELERY_TASK_SERIALIZER: ${CELERY_TASK_SERIALIZER}
CELERY_RESULT_SERIALIZER: ${CELERY_RESULT_SERIALIZER}
CELERY_ACCEPT_CONTENT: ${CELERY_ACCEPT_CONTENT}
C_FORCE_ROOT: true
volumes:
- type: bind
source: ./backend
target: /app
depends_on:
- db
- redis
celery-flower:
build:
context: backend
dockerfile: Dockerfile
command:
- 'celery'
- '-A'
- 'app'
- 'flower'
- '--broker=redis://redis:6379/0'
- '--port=5555'
- '--persistent=True'
- '--db=/data/flower'
- '--url_prefix=flower'
expose:
- 5555
environment:
DATABASE_URL: sqlite:// # ?! WTF? Why do I need this?
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
CELERY_TASK_SERIALIZER: ${CELERY_TASK_SERIALIZER}
CELERY_RESULT_SERIALIZER: ${CELERY_RESULT_SERIALIZER}
CELERY_ACCEPT_CONTENT: ${CELERY_ACCEPT_CONTENT}
depends_on:
- redis
- celery-worker
volumes:
- flower_data:/data
- ./backend/app/config.py:/app/config.py
volumes:
flower_data: