-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
175 lines (166 loc) · 4.02 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
services:
db:
container_name: postgres-olivin
image: postgres:14.6
hostname: postgres
ports:
- "5432:5432"
- "5433:5432"
env_file:
- ./.envs/dev/postgres.env
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
restart: on-failure
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER"
]
interval: 3s
timeout: 3s
retries: 30
init: true
profiles: ["dev", "postgres", "backend", "less-dev"]
redis:
image: redis
hostname: redis
container_name: redis-olivin
build:
context: ./backend
dockerfile: ./docker/redis/Dockerfile
env_file:
- ./.envs/dev/redis.env
ports:
- "6379:6379"
volumes:
- redis_data:/data
profiles: ["dev", "redis", "backend", "less-dev"]
backend: &backend
container_name: django-olivin
build:
context: ./backend
dockerfile: ./docker/ninja/Dockerfile
privileged : true
stdin_open: true
tty: true
command:
- /django.sh
env_file:
- ./.envs/dev/django.env
- ./.envs/dev/postgres.env
- ./.envs/dev/redis.env
- ./.envs/dev/mail.env
- ./.envs/dev/minio.env
- ./.envs/.env
volumes:
- ./backend:/src:z
ports:
- "8000:8000"
depends_on: [db, redis, mail, minio]
profiles: ["dev", "backend"]
celery-beat:
<<: *backend
ports: []
command: /celery/beat.sh
container_name: celery-beat-olivin
volumes:
- ./backend:/src:z
env_file:
- ./.envs/dev/django.env
- ./.envs/dev/postgres.env
- ./.envs/dev/redis.env
- ./.envs/dev/mail.env
- ./.envs/dev/minio.env
- ./.envs/.env
depends_on: [db, redis, mail, minio]
profiles: ["dev", "backend", "less-dev"]
healthcheck:
test: "${DOCKER_WEB_HEALTHCHECK_TEST:-curl localhost:8000/up}"
interval: "60s"
timeout: "3s"
start_period: "5s"
retries: 3
celery-worker:
<<: *backend
ports: []
command: /celery/worker.sh
container_name: celery-worker-olivin
volumes:
- ./backend:/src:z
env_file:
- ./.envs/dev/django.env
- ./.envs/dev/postgres.env
- ./.envs/dev/redis.env
- ./.envs/dev/mail.env
- ./.envs/dev/minio.env
- ./.envs/.env
depends_on: [db, redis, mail, minio]
profiles: ["dev", "backend", "less-dev"]
healthcheck:
test: "${DOCKER_WEB_HEALTHCHECK_TEST:-curl localhost:8000/up}"
interval: "60s"
timeout: "3s"
start_period: "5s"
retries: 3
flower:
<<: *backend
ports:
- "5555:5555"
command: /celery/flower.sh
container_name: flower-olivin
volumes:
- ./backend:/src:z
env_file:
- ./.envs/dev/django.env
- ./.envs/dev/postgres.env
- ./.envs/dev/redis.env
- ./.envs/dev/mail.env
- ./.envs/dev/flower.env
- ./.envs/dev/minio.env
- ./.envs/.env
depends_on: [db, redis, mail, minio]
profiles: ["dev", "backend", "less-dev"]
mail:
image: sj26/mailcatcher
container_name: mail-olivin
ports:
- "1080:1080" # port web
- "1025:1025" # port SMTP
volumes:
- mail_data:/data
profiles: ["dev", "mail", "backend", "less-dev"]
minio:
container_name: minio-olivin
image: minio/minio:latest
ports:
- "9000:9000" # port web
- "9001:9001" # port console
command: server /data --console-address ":9001"
env_file:
- ./.envs/dev/minio.env
volumes:
- minio_data:/data
profiles: ["dev", "minio", "backend", "less-dev"]
frontend:
build:
context: ./frontend
dockerfile: ./docker/Dockerfile
container_name: react-olivin
env_file:
- ./.envs/dev/react.env
stdin_open: true
tty: true
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
profiles: ["dev", "frontend"]
volumes:
postgres_data:
redis_data:
mail_data:
minio_data: