-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
48 lines (46 loc) · 1.44 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
version: '3.7'
services:
postgres:
image: postgres:10.5
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
deploy:
resources:
limits:
cpus: '1'
memory: 1G
volumes:
- ./docker-seed/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
- POSTGRES_USER=${POSTGRES_USER:-pna_admin}
- POSTGRES_PASSWORD=${PGPASSWORD:-pass}
- POSTGRES_DB=pna_${APP_ENV:-prod}
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-d", "pna_${APP_ENV:-prod}", "-U", "${POSTGRES_USER:-pna_admin}"]
start_period: 1s0s
interval: 10s
timeout: 5s
retries: 5
migrate:
build:
context: ./
image: phone-number-allot:v1
environment:
- DATABASE_URL=postgresql://pna_admin:pass@postgres:5432/pna_${APP_ENV:-prod}
- APP_ENV=${APP_ENV:-prod}
entrypoint: ['python','manage.py','migrate']
depends_on:
- postgres
app:
build:
context: ./
image: phone-number-allot:v1
ports:
- "5000:5000"
environment:
- DATABASE_URL=postgresql://pna_admin:pass@postgres:5432/pna_${APP_ENV:-prod}
- APP_ENV=${APP_ENV:-prod}
depends_on:
- postgres
- migrate