-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
39 lines (35 loc) · 931 Bytes
/
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
version: '3.7'
services:
testapp:
build:
context: .
target: app
image: testapp
container_name: testapp
command: bash -c "gunicorn -k uvicorn.workers.UvicornWorker -w ${WORKERS} -b 0.0.0.0:8000 main:app"
depends_on:
- database
restart: on-failure
volumes:
- ./src/:/app/src/
environment:
ENVIRONMENT: prod
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
DEBUG: 'False'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_DB: '${POSTGRES_DB}'
WORKERS: '${WORKERS:-1}'
database:
image: postgres:13.4-alpine
container_name: postgres
volumes:
- ./data/postgres/:/var/lib/postgresql/
restart: on-failure
environment:
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
POSTGRES_DB: '${POSTGRES_DB}'
ports:
- 5432:5432