mirror of https://github.com/kern/filepizza
Use multi-stage docker build
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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue