-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (48 loc) · 1.17 KB
/
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
47
48
49
50
services:
# PostgreSQL Database
db:
image: postgres:17.4
container_name: work-hours-db-toshiba
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: workhours
volumes:
- /home/ville/work_postgres_data:/var/lib/postgresql/data
- ./database/tables.sql:/docker-entrypoint-initdb.d/01-tables.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d workhours"]
interval: 10s
timeout: 5s
retries: 5
# Backend Node.js Application
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: work-hours-backend
restart: always
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: production
DB_HOST: db
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: workhours
DB_PORT: 5432
PORT: 3001
# Frontend React Application
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: work-hours-frontend
restart: always
depends_on:
- backend
ports:
- "20080:80"
- "20443:443"