forked from Ryan-Miao/docker-yapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
40 lines (39 loc) · 962 Bytes
/
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
# Use root/example as user/password credentials
version: '3.1'
services:
mongo:
image: mongo:4
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: yapi
volumes:
- ./mongo-conf:/docker-entrypoint-initdb.d
- ./mongo/etc:/etc/mongo
- ./mongo/data/db:/data/db
ports:
- 27017:27017
healthcheck:
test: ["CMD", "netstat -anp | grep 27017"]
interval: 2m
timeout: 10s
retries: 3
yapi:
build:
context: ./
dockerfile: Dockerfile
image: yapi
restart: always
# 第一次启动使用
command: "yapi server"
# 之后使用下面的命令
# command: "node /my-yapi/vendors/server/app.js"
volumes:
- ./my-yapi:/my-yapi
ports:
- 9090:9090
- 3000:3000 #这个没用了,我换成80端口了
- 80:80
depends_on:
- mongo