-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
44 lines (40 loc) · 1.32 KB
/
docker-compose.yaml
File metadata and controls
44 lines (40 loc) · 1.32 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
services:
backend:
build: ./backend # Point to the backend folder where the Dockerfile is located
ports:
- "8000:8000" # Map host port 8000 to container port 8000
volumes:
- ./backend:/app # Mount backend directory for live code updates
env_file: "./backend/.env" # Use the .env file inside backend
environment:
- IS_DOCKER_CONTAINER=1
depends_on:
db:
condition: service_healthy
restart: always # Restart container if it crashes
frontend:
build: ./frontend # Point to the frontend folder where the Dockerfile is located
ports:
- "3000:3000" # Map host port 3000 to container port 3000
env_file: "./frontend/.env"
environment:
- NODE_ENV=production
restart: always
db:
image: postgres:13 # Use the official PostgreSQL image
ports:
- "5433:5432" # Map host port 5433 to container port 5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: jobseeker_analytics
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d jobseeker_analytics"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgres_data:/var/lib/postgresql/data # Persist database data
- ./backend/db/init.sql:/docker-entrypoint-initdb.d/init.sql
volumes:
postgres_data: