-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
40 lines (36 loc) · 1.05 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
version: '2.1' # Using 2.1 for healthcheck
services:
http4s-db-scratchpad:
image: http4s-db-scratchpad:1.0-SNAPSHOT
environment:
- HTTP_PORT=${SERVER_HTTP_PORT:-8080}
- DB_USER=${POSTGRES_USER:-user}
- DB_HOST=${POSTGRES_HOST:-postgres}
- DB_PORT=${POSTGRES_PORT:-5432}
- DB_PASSWORD=${POSTGRES_PASSWORD:-passw0rd}
- DB_NAME=${POSTGRES_DB:-database}
ports:
- "80:8080"
links:
- postgres
depends_on:
- proxy-dep
# proxy dependency in order to make sure postgres is running when executing docker-compose run
proxy-dep:
image: busybox
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:9.6.5-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER:-user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-passw0rd}
- POSTGRES_DB=${POSTGRES_DB:-database}
ports:
- "5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 1s
timeout: 1s
retries: 50