-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (61 loc) · 1.74 KB
/
docker-compose.yml
File metadata and controls
76 lines (61 loc) · 1.74 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: "3.9"
services:
# Database Service
database-service:
build: ./Database
image: shaharmaoz/vacations-database-image:1.0
container_name: vacations-database-container
restart: unless-stopped
# Volume for persistent data storage
volumes:
- vacations-volume:/var/lib/mysql
- ./Backend/src:/app/src
- /app/node_modules
environment:
MYSQL_ROOT_PASSWORD: Wonderland
MYSQL_USER: Alice
MYSQL_PASSWORD: Wonderland
MYSQL_DATABASE: vacatier
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 24
# Backend Service
backend-service:
build: ./Backend
image: shaharmaoz/vacations-backend-image:1.0
container_name: vacations-backend-container
restart: unless-stopped
# Wait until the database-service is healthy
depends_on:
database-service:
condition: service_healthy
# Map port 4100 from container to host
ports:
- "4100:4100"
# Mount the src directory for hot reloading (if supported)
volumes:
- ./Backend/src:/app/src
environment:
MYSQL_HOST: database-service
MYSQL_USER: Alice
MYSQL_PASSWORD: Wonderland
MYSQL_DATABASE: vacatier
# Frontend Service
frontend-service:
build: ./Frontend
image: shaharmaoz/vacations-frontend-image:1.0
container_name: vacations-frontend-container
restart: unless-stopped
# Wait until backend-service is ready
depends_on:
- backend-service
# Map port 3000 from container to 3100 on host
ports:
- "3100:3000"
# Mount the src directory for hot reloading (if supported)
volumes:
- ./Frontend/src:/app/src
volumes:
vacations-volume: