-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (48 loc) · 1.05 KB
/
docker-compose.yml
File metadata and controls
53 lines (48 loc) · 1.05 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
version: '3.8'
services:
backend:
build:
context: ./Go
ports:
- "8080:8080"
env_file:
- ./Go/.env
environment:
DB_USER: root
DB_PASSWORD: kenzi123
DB_HOST: database
DB_NAME: userdb
depends_on:
- database
networks:
- app_network
command: /wait-for-it.sh database:3306 --timeout=30 -- ./main
frontend:
build:
context: .
dockerfile: ./src/Dockerfile
ports:
- "3000:3000"
env_file:
- ./src/.env
depends_on:
- backend
networks:
- app_network
database:
build:
context: ./database
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: kenzi123
MYSQL_DATABASE: userdb
volumes:
- db_data:/var/lib/mysql # Ensure MySQL data is persisted
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql # Ensure init.sql is loaded automatically
networks:
- app_network
volumes:
db_data:
networks:
app_network: