-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (69 loc) · 1.97 KB
/
docker-compose.yml
File metadata and controls
72 lines (69 loc) · 1.97 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
services:
# --------------------------------------------------------
# 1. (Database MySQL)
# --------------------------------------------------------
db:
image: mysql:8.0
restart: always
environment:
# Mengambil password dari file .env di mesin lokal Anda
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: db_komputasi
ports:
- "3306:3306"
volumes:
- aset_data_mysql:/var/lib/mysql
# Seed data: MySQL otomatis menjalankan file .sql di folder ini saat inisialisasi pertama
- ./database/schemas:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 5
# --------------------------------------------------------
# 2. (Backend Python/FastAPI)
# --------------------------------------------------------
backend:
build: ./backend
restart: unless-stopped
ports:
- "8000:8000"
env_file:
# Menyuntikkan seluruh isi .env ke dalam container backend
- ./backend/.env
depends_on:
db:
condition: service_healthy
volumes:
- ./backend:/app
# --------------------------------------------------------
# 3. (Frontend Vite/React + pnpm)
# --------------------------------------------------------
frontend:
build: ./frontend
restart: unless-stopped
ports:
- "5173:5173"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
stdin_open: true
tty: true
# --------------------------------------------------------
# 4. (Ngrok Tunnel)
# --------------------------------------------------------
ngrok:
image: ngrok/ngrok:latest
restart: unless-stopped
profiles: ["tunnel"]
command:
- "http"
- "frontend:5173" # Mengarah ke service frontend secara internal
environment:
- NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN}
depends_on:
- frontend
volumes:
aset_data_mysql: