-
Notifications
You must be signed in to change notification settings - Fork 47
/
compose.yml
62 lines (57 loc) · 1.94 KB
/
compose.yml
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
services:
mysql:
restart: always
image: ${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}/mysql:8.4.2
ports:
- "3308:3306"
environment:
- TZ=Asia/Shanghai
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE_NAME}
- MYSQL_CHARSET=utf8mb4
- MYSQL_COLLATION=utf8mb4_0900_ai_ci
volumes:
- mysql_data:/var/lib/mysql
- ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
- ./mysql/init-scripts:/docker-entrypoint-initdb.d
vite-vue3:
restart: always
build:
target: vite-vue3-frontend
image: ${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}/fullstack-blog-vite-vue3:${VITE_VUE3_VERSION:-latest}
ports:
- "3000:80"
environment:
- BACKEND_PORT=8002
command: /bin/bash -c "envsubst '$$BACKEND_PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
webpack-vue3:
restart: always
build:
target: webpack-vue3-frontend
image: ${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}/fullstack-blog-webpack-vue3:${WEBPACK_VUE3_VERSION:-latest}
ports:
- "3001:80"
environment:
- BACKEND_PORT=8002
command: /bin/bash -c "envsubst '$$BACKEND_PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
express-server:
restart: always
build:
target: express-backend
image: ${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}/fullstack-blog-express:${EXPRESS_SERVER_VERSION:-latest}
ports:
- "8002:8002"
volumes:
- ./express-server/config/env.js:/usr/src/fullstack-blog/app/express-server/src/config/env.js
environment:
- NODE_ENV=production
- PORT=8002
- NPM_CONFIG_REGISTRY=https://registry.npmmirror.com
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE_NAME}
depends_on:
- mysql
volumes:
mysql_data:
# 如果还有其他服务,也可以在这里添加
# ...