使用docker-compose.yml部署node项目

一、使用docker-compose.ymlDockerfile构建项目

  • 1、项目基本介绍

    使用express框架的路由访问views目录下的静态文件

  • 2、项目的基本结构

    .
    ├── Dockerfile
    ├── README.md
    ├── docker-compose.yml
    ├── index.js
    ├── package-lock.json
    ├── package.json
    └── views
        ├── index.html
        └── other.html
    
  • 3、index.js文件代码

    const express = require('express')
    const app = express(

猜你喜欢

转载自blog.csdn.net/kuangshp128/article/details/115035689