-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
62 lines (57 loc) · 1.51 KB
/
docker-compose.prod.yml
File metadata and controls
62 lines (57 loc) · 1.51 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
version: '3.9'
services:
backend:
container_name: backend
restart: unless-stopped
build:
context: ./services/backend/
dockerfile: Dockerfile-prod
command: sh -c "while ! nc -z backend-db 5432; do sleep 0.1; done; exec gunicorn --workers 3 --bind 0.0.0.0:8000 wsgi:app"
volumes:
- ./services/backend/:/usr/src/app/
ports:
- "5001:8000"
environment:
- FLASK_APP=project/__init__.py
- FLASK_ENV=production
- APP_SETTINGS=project.config.ProductionConfig
- DATABASE_URL=postgresql://postgres:postgres@backend-db:5432/backend_prod
depends_on:
- backend-db
backend-db:
image: postgres:13
container_name: backend-db
volumes:
- postgres_volume:/var/lib/postgresql/data
ports:
- "5435:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=backend_prod
my-app:
container_name: my-app
build:
context: ./services/client/my-app/
dockerfile: Dockerfile-prod-2
volumes:
- ./services/client/my-app/build:/usr/share/nginx/html
ports:
- "3000:80"
depends_on:
- backend
nginx:
container_name: nginx
image: nginx:latest
ports:
- "8000:80"
- "443:443"
restart: unless-stopped
volumes:
- ./services/client/my-app/nginx.conf:/etc/nginx/nginx.conf
- ./services/client/my-app/prod.conf:/etc/nginx/conf.d/default.conf
depends_on:
- backend
- my-app
volumes:
postgres_volume: