-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.gunicorn.yml
47 lines (45 loc) · 1.06 KB
/
docker-compose.gunicorn.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
version: '3.8'
services:
web:
build: .
ports:
- 5000:5000
volumes:
- .:/app
# Gunicorn logs are written to ./access.log and error.log files
command:
[
'gunicorn',
'-c',
'deploy/gunicorn_config.py',
'--workers',
'4',
'--access-logfile',
'/app/access.log',
'--error-logfile',
'/app/error.log',
'--log-level',
'debug',
'--capture-output',
'app:create_app()',
]
environment:
FLASK_APP: app:create_app()
ENV: production
# Do not store passwords in git the in real-world setting!
SQLALCHEMY_DATABASE_URI: postgresql://db:password@db:5432/db
SQLALCHEMY_POOL_SIZE: 30
SQLALCHEMY_MAX_OVERFLOW: 0
db:
image: postgres:13.4-alpine
ports:
- 5432:5432
volumes:
- pg_data:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=db
- POSTGRES_USER=db
# Do not store passwords in git the in real-world setting!
- POSTGRES_PASSWORD=password
volumes:
pg_data: