-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
47 lines (43 loc) · 934 Bytes
/
docker-compose.yaml
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
version: '3.9'
services:
app:
tty: true # This is important to keep the container running
restart: always
image: ticket-booking
container_name: ticket-booking
build: .
ports:
- "3000:3000"
env_file:
- .env
networks:
- application
depends_on:
db:
condition: service_healthy
volumes:
- .:/src/app
command: air -c .air.toml
db:
image: postgres:alpine
container_name: ticket-booking-db
environment:
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_USER=${DB_USER}
- POSTGRES_DB=${DB_NAME}
- POSTGRES_HOST=${DB_HOST}
ports:
- "5432:5432"
volumes:
- postgres-db:/var/lib/postgresql/data
networks:
- application
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
networks:
application:
volumes:
postgres-db: