当前位置: 首页 > 工具软件 > docker-npm > 使用案例 >

docker-compose 食用指南, 部署node项目

苏磊
2023-12-01

how to use docker-compose!

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

 类似资料: