-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
89 lines (83 loc) · 1.64 KB
/
docker-compose.yaml
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
services:
backend:
build: ./backend
expose:
- 5000
restart: always
command: gunicorn --bind 0.0.0.0:5000 --workers 2 --threads 5 manage:app
env_file:
- ./backend/.env.prod
depends_on:
- db
environment:
DATABASE: postgres
DATABASE_URI: postgresql://admin:admin@db:5432
deploy:
mode: Replicated
replicas: 2
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
networks:
- josa
volumes:
- ./backend/src/uploads:/app/src/uploads
stdin_open: true
tty: true
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: frontend
container_name: frontend-cont
restart: always
ports:
- "80:80"
networks:
- josa
depends_on:
- backend
env_file:
- ./frontend/.env
stdin_open: true
tty: true
db:
image: postgres:13
ports:
- "5432:5432"
restart: always
networks:
- josa
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
worker:
build: ./backend
command: ./celery.sh
env_file:
- ./backend/.env.prod
depends_on:
- backend
- redis
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
networks:
- josa
volumes:
- ./backend/src/uploads:/app/src/uploads
redis:
image: redis:6-alpine
ports:
- "6379:6379"
restart: always
networks:
- josa
volumes:
postgres_data: {}
networks:
josa:
driver: bridge