-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
46 lines (46 loc) · 1.25 KB
/
docker-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
version: '3.7'
services:
mysql_db_container:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: rootpassword # root账号密码
ports:
- 3306:3306
volumes:
- mysql_db_data_container:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 5
adminer_container:
image: adminer:latest
environment:
ADMINER_DEFAULT_SERVER: mysql_db_container
ports:
- 8080:8080
nuxt_app_container:
container_name: nuxt_app
restart: always
#构建容器
build:
context: .
# 自动输入Y防止造成编译卡死
args:
- "-y"
ports:
- "3004:3000"
environment:
DATABASE_URL: mysql://root:rootpassword@mysql_db_container:3306/ycxt
NUXT_BASE_URL: https://jsonplaceholder.typicode.com
JSON_SECRET: thisisjsonsecret
#command: >
# /bin/sh -c 'npm run migrate && npm run build && npm start'
command: >
/bin/sh -c 'npm run clear && npm run migrate && npm run build && npm start'
depends_on:
mysql_db_container:
condition: service_healthy
volumes:
mysql_db_data_container: