-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
38 lines (34 loc) · 986 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"
services:
db:
image: postgres:9.5
environment:
- POSTGRES_USER=$APP_DB_USERNAME
- POSTGRES_PASSWORD=$APP_DB_PASSWORD
- POSTGRES_DB=$APP_DB_NAME
ports:
- $APP_DB_PORT:$APP_DB_PORT
volumes:
- db-data:/var/lib/postgresql/data
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
app:
build: .
command:
sh -c "./wait-for db:$APP_DB_PORT -- ./entrypoint.sh"
restart: on-failure
environment:
- APP_DB_USERNAME=$APP_DB_USERNAME
- APP_DB_PASSWORD=$APP_DB_PASSWORD
- APP_DB_NAME=$APP_DB_NAME
- APP_DB_HOSTNAME=db
- APP_DB_PORT=$APP_DB_PORT
- APP_PORT=$APP_PORT
- MIGRATE=$MIGRATE
- DEBUG=$DEBUG
ports:
- $APP_PORT:$APP_PORT
depends_on:
- db
volumes:
db-data:
driver: local