-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
56 lines (55 loc) · 1.33 KB
/
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
48
49
50
51
52
53
54
55
56
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: prod
restart: unless-stopped
ports:
- ${SERVER_PORT}:${SERVER_PORT}
environment:
PORT: ${SERVER_PORT}
DB_HOST: database
DB_PORT: ${DB_PORT}
DB_DATABASE_NAME: ${DB_DATABASE_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
depends_on:
database:
condition: service_healthy
networks:
- dashnest_net
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: frontend
restart: unless-stopped
depends_on:
- backend
ports:
- 5173:5173
networks:
- dashnest_net
database:
image: postgres:latest
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "${DB_PORT}:5432"
volumes:
- ./local_db_data:/var/lib/postgresql/data # Database data in local directory
- ./backend/cmd/migrate/migrations:/docker-entrypoint-initdb.d # Migrations
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USER} -d ${DB_DATABASE_NAME}'"]
interval: 5s
timeout: 5s
retries: 3
start_period: 15s
networks:
- dashnest_net
networks:
dashnest_net: