-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (45 loc) · 1.29 KB
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (45 loc) · 1.29 KB
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
services:
auth-service:
build:
context: .
dockerfile: Dockerfile
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=db #or ${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_PORT}
- JWT_SECRET=${JWT_SECRET}
- SERVER_PORT=${SERVER_PORT}
depends_on:
db:
condition: service_healthy
networks:
- auth-network
db:
image: postgres:17-bookworm
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
- ./migrations:/migrations
healthcheck:
test: ["CMD-SHELL", "PGPASSWORD=${POSTGRES_PASSWORD} pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB} && PGPASSWORD=${POSTGRES_PASSWORD} psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -c 'SELECT 1'"]
interval: 10s
timeout: 10s
retries: 5
start_period: 30s
networks:
- auth-network
networks:
auth-network:
driver: bridge
volumes:
postgres_data: