2023-03-10 15:43:09 +00:00
|
|
|
FROM bitnami/node:18 AS builder
|
2020-10-11 17:47:33 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2023-03-10 15:43:09 +00:00
|
|
|
FROM node:18-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
|
|
|
|
|
2023-03-10 16:20:31 +00:00
|
|
|
RUN /bin/cp -r ./public /home/web/tmp/public && \
|
|
|
|
/bin/touch /home/web/tmp/.updatePublic
|
|
|
|
|
2023-03-10 15:54:33 +00:00
|
|
|
EXPOSE 8000
|
|
|
|
|
2023-03-05 17:26:13 +00:00
|
|
|
CMD ["node", "index.mjs"]
|