-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
46 lines (42 loc) · 941 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
39
40
41
42
43
44
45
46
version: "3.9"
services:
postgres:
image: postgres:15.2
environment:
- POSTGRES_PASSWORD=${PG_PASSWORD}
- POSTGRES_USER=${PG_USER}
- POSTGRES_DB=${PG_DATABASE}
env_file:
- .env
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- db-volume:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${PG_DATABASE} -U $${PG_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
networks:
- dynamic-user-segmentation
api:
build:
context: .
dockerfile: docker/Dockerfile
env_file:
- .env
ports:
- "8080:8080"
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
networks:
- dynamic-user-segmentation
volumes:
db-volume:
networks:
dynamic-user-segmentation: