-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
51 lines (48 loc) · 1.24 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
49
50
51
version: '3.8'
services:
# server:
# container_name: server
# image: server
# ports:
# - 3333:3333
# env_file:
# - .env
# environment:
# - ENVIRONMENT=docker
# - DATABASE_HOST=postgres # this has to match the name of the database service being used!
# healthcheck:
# test: wget localhost:3333/api/health -q -O - > /dev/null 2>&1
# interval: 10s
# timeout: 5s
# retries: 3
# start_period: 30s
# depends_on:
# postgres:
# condition: service_healthy
db:
container_name: postgres
image: postgres:alpine
ports:
- 5432:5432
# explicitly set because the .env variable names don't match
# what is expected in the container
environment:
- POSTGRES_USER=${DATABASE_USERNAME}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- ./tmp/pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', "su -c 'pg_isready -U postgres' postgres"]
interval: 30s
timeout: 5s
retries: 3
adminer:
container_name: admin
image: adminer:latest
ports:
- 8080:8080
depends_on:
db:
condition: service_healthy