-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
37 lines (35 loc) · 993 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
version: "3.9"
services:
postgres:
image: postgres:14.4-alpine
container_name: hexagony-database-pg
hostname: hexagony-database-pg
restart: unless-stopped
volumes:
- ./db/postgres:/docker-entrypoint-initdb.d/
- ./db/postgres/.data:/var/lib/postgresql/data
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
environment:
- PGDATA=/var/lib/postgresql/data/pgdata # named volume (windows workaround to persist data)
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
env_file: .env
api:
build:
context: .
container_name: hexagony-api
hostname: hexagony-api
restart: unless-stopped
ports:
- ${PORT}:${PORT}
depends_on:
postgres:
condition: service_healthy
env_file: .env