2020-10-11 17:47:33 +00:00
|
|
|
FROM bitnami/node:12 AS builder
|
|
|
|
|
|
|
|
COPY package*.json /app/
|
|
|
|
WORKDIR /app
|
|
|
|
RUN ["npm", "install"]
|
|
|
|
|
|
|
|
COPY . /app
|
2020-10-26 18:58:38 +00:00
|
|
|
RUN npm run compile_production && \
|
|
|
|
npm prune --production
|
2020-10-11 17:47:33 +00:00
|
|
|
|
2020-10-26 18:58:38 +00:00
|
|
|
FROM node:lts-alpine AS production
|
2020-10-11 17:47:33 +00:00
|
|
|
ENV NODE_ENV="production"
|
|
|
|
ENV PORT=8000
|
|
|
|
|
2020-10-26 18:58:38 +00:00
|
|
|
RUN adduser web --disabled-password
|
|
|
|
USER web
|
|
|
|
RUN /bin/mkdir -p /home/web/tmp/public
|
2020-10-11 17:47:33 +00:00
|
|
|
|
|
|
|
COPY --chown=web:web --from=builder /app /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
2020-10-26 18:58:38 +00:00
|
|
|
RUN /bin/cp -r ./public /home/web/tmp/public && \
|
|
|
|
/bin/touch /home/web/tmp/.updatePublic
|
2020-10-11 17:47:33 +00:00
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
CMD ["node", "index.js"]
|