Use multi-stage docker build

pull/127/head
Hugo van Rijswijk 5 years ago
parent e4fb3431fb
commit 06d152a929

@ -1,9 +1,24 @@
FROM node:alpine
MAINTAINER Alexander Kern <filepizza@kern.io>
FROM node:alpine as builder
LABEL maintainer="Alexander Kern <filepizza@kern.io>"
WORKDIR /root/filepizza
COPY . ./
# copy production node_modules aside
RUN npm ci --only=production
RUN cp -R node_modules prod_node_modules
RUN npm install && npm run build
FROM node:alpine
LABEL maintainer="Alexander Kern <filepizza@kern.io>"
WORKDIR /root/filepizza
# copy production files
COPY --from=builder /root/filepizza/prod_node_modules ./node_modules
COPY --from=builder /root/filepizza/dist ./dist
ENV NODE_ENV production
EXPOSE 80
CMD node ./dist/index.js
ENTRYPOINT node ./dist/index.js

868
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -35,30 +35,16 @@
]
},
"dependencies": {
"alt": "^0.14.4",
"classnames": "^1.2.0",
"express": "^4.12.0",
"express-force-ssl": "^0.3.1",
"express-winston": "^0.3.1",
"filepizza-socket": "^1.0.0",
"newrelic": "^1.21.1",
"nib": "^1.1.0",
"node-uuid": "^1.4.3",
"nodemon": "^1.4.1",
"react": "^0.13.0",
"react-frozenhead": "^0.3.0",
"react-google-analytics": "^0.2.0",
"react-qr": "0.0.2",
"react-router": "^0.13.1",
"socket.io": "^1.3.5",
"socket.io-client": "^1.3.5",
"stylus": "^0.52.4",
"twilio": "^2.9.1",
"webrtcsupport": "^2.2.0",
"winston": "^1.0.1",
"xkcd-password": "^1.2.0"
"winston": "^1.0.1"
},
"devDependencies": {
"alt": "^0.14.4",
"babel-cli": "^6.16.0",
"babel-core": "^6.17.0",
"babel-loader": "^6.2.5",
@ -67,13 +53,27 @@
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-stage-0": "^6.16.0",
"classnames": "^1.2.0",
"css-loader": "^0.28.4",
"filepizza-socket": "^1.0.0",
"json-loader": "^0.5.4",
"nib": "^1.1.0",
"node-uuid": "^1.4.3",
"nodemon": "^1.19.4",
"noop-loader": "^1.0.0",
"null-loader": "^0.1.1",
"react": "^0.13.0",
"react-frozenhead": "^0.3.0",
"react-google-analytics": "^0.2.0",
"react-qr": "0.0.2",
"react-router": "^0.13.1",
"socket.io-client": "^1.3.5",
"style-loader": "^0.18.2",
"stylus": "^0.52.4",
"stylus-loader": "^3.0.1",
"webpack": "^1.12.14",
"webpack-dev-middleware": "^1.6.1"
"webpack-dev-middleware": "^1.6.1",
"webrtcsupport": "^2.2.0",
"xkcd-password": "^1.2.0"
}
}

Loading…
Cancel
Save