-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
33 lines (32 loc) · 935 Bytes
/
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
services:
go-backend:
container_name: go-backend
build: .
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_DATABASE: ${POSTGRES_DATABASE}
ports:
- "9000:9000"
- "587:587"
depends_on:
postgres-db:
condition: service_healthy
postgres-db:
container_name: postgres-db
image: postgres:12-alpine
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DATABASE: ${POSTGRES_DATABASE}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DATABASE}'"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./backend/database/pgdata:/var/lib/postgresql/data
- ./scripts/init.sh:/docker-entrypoint-initdb.d/init.sh