-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (77 loc) · 2.38 KB
/
docker-compose.yml
File metadata and controls
80 lines (77 loc) · 2.38 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
77
78
79
80
services:
mysql:
image: mysql:8.4
restart: unless-stopped
command:
- --default-authentication-plugin=mysql_native_password
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_DATABASE: studyhub
MYSQL_USER: studyhub
MYSQL_PASSWORD: studyhub
MYSQL_ROOT_PASSWORD: studyhub-root
MYSQL_INITDB_SKIP_TZINFO: "1"
ports:
- "3307:3306"
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$$MYSQL_ROOT_PASSWORD --silent"]
interval: 5s
timeout: 5s
retries: 20
start_period: 20s
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
working_dir: /app
command: uvicorn app.main:app --host 0.0.0.0 --port 8011 --reload
environment:
STUDYHUB_ENVIRONMENT: local-dev
STUDYHUB_HOST: 0.0.0.0
STUDYHUB_PORT: 8011
STUDYHUB_DATABASE_URL: mysql+pymysql://studyhub:studyhub@mysql:3306/studyhub?charset=utf8mb4
STUDYHUB_LOCAL_DEV_ROOT_DIR: /workspace/.local-dev
STUDYHUB_LOCAL_DEV_BOOTSTRAP_USER: "true"
STUDYHUB_LOCAL_DEV_QUICK_LOGIN_ENABLED: "true"
STUDYHUB_MAIL_PROVIDER: local_outbox
STUDYHUB_STORAGE_PROVIDER: local_fs
STUDYHUB_PAYMENT_PROVIDER: local_alipay
STUDYHUB_JWT_SECRET: studyhub-fastapi-local-dev-secret-change-me-20260327
volumes:
- ./backend:/app
- ./.local-dev-docker:/workspace/.local-dev
ports:
- "8111:8011"
depends_on:
mysql:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
restart: unless-stopped
working_dir: /app
command: sh -c "if [ ! -d node_modules/next ]; then npm install; fi && npm run dev -- --hostname 0.0.0.0 --port 3000"
environment:
NODE_ENV: development
WATCHPACK_POLLING: "true"
CHOKIDAR_USEPOLLING: "true"
NEXT_PUBLIC_API_BASE: http://localhost:8111/api
NEXT_PUBLIC_DEV_API_BASE: http://localhost:8111/api
API_BASE_URL: http://backend:8011/api
API_BASE_INTERNAL: http://backend:8011/api
volumes:
- ./frontend:/app
- frontend-node-modules:/app/node_modules
ports:
- "3100:3000"
depends_on:
backend:
condition: service_started
volumes:
mysql-data:
frontend-node-modules: