目录结构
/c
- /c/docker-compose.yml
- /c/k
— /c/k/Dockerfile
— /c/k/app.js
— /c/k/node_modules
— /c/k/package-lock.json
— /c/k/package.json
root@ubuntu:/home/ubuntu/c/k# lsDockerfile app.js node_modules package-lock.json package.json
docker-compose
version: "3.2"
services:
koa_demo:
# 把镜像先打包 => 后运行
build:
# 指定上下文的Dockerfile所在目录
context: "./k"
# 启动的dockerfile名称
dockerfile: Dockerfile
ports:
- "5000:5000"
~
docker-compose up 然后其启动了
