version: "2"
services:
webapp:
image: "node:latest"
user: "root"
working_dir: "/home/app"
ports:
[8090:4000]
volumes:
- /mydata/data/blog/app:/home/app
command:
- /bin/sh
- -c
- |
echo 'run the bash command..'
npm -v
npm config set registry https://registry.npm.taobao.org
npm install -g hexo-cli
cd /home/app
npm install
pwd
nohup hexo sever &
echo 'success.. start..'
pwd
echo '查看输出:...'
cat nohup.out
hexo server &
tail -f /dev/null
tty: true
stdin_open: true