Nodejs Express dockerfile最佳实践

1. 少啰嗦,先看代码 1.1. package.json { "name": "xxx", "version": "0.0.0", "private": true, "scripts": { "start": "node ./bin/www", "forever": "node_modules/forever/bin/forever bin/www" }, "dependencies": { "async": "0.9.0", "body-parser": "1.13.2", "compression": "1.6.2", "config": "1.12.0", "connect-multiparty": "2.0.0", "cookie-parser": "1.3.5", "debug": "2.2.0", "ejs": "2.3.3", "express": "4.13.1", "forever": "0.15.3", "http-proxy-middleware": "0.17.3", "log4js": "0.6.24", "serve-favicon": "2.3.0" } } 1.2. dockerfile FROM node:9.2.1-alpine RUN apk update && apk add bash tzdata \ && cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime WORKDIR /app COPY package....

2018-02-08 · 1 min · 王端端