2024-02-05 11:44:17 +00:00
|
|
|
FROM node:21-alpine AS build
|
|
|
|
|
|
|
|
WORKDIR /app/
|
|
|
|
COPY --chown=node:node package*.json ./
|
2024-02-05 11:47:57 +00:00
|
|
|
RUN npm install -g npm@10.4.0 && npm install
|
2024-02-05 11:44:17 +00:00
|
|
|
COPY --chown=node:node . .
|
|
|
|
RUN npm run build
|
|
|
|
RUN npm cache clean --force
|
|
|
|
USER node
|
|
|
|
|
|
|
|
###################
|
|
|
|
# PRODUCTION
|
|
|
|
###################
|
|
|
|
FROM nginx:stable-alpine AS nginx
|
|
|
|
|
|
|
|
COPY --from=build /app/dist/ /usr/share/nginx/html/
|
|
|
|
COPY --from=build /app/run.sh /app/
|
|
|
|
COPY --from=build /app/nginx.conf /configs/
|
|
|
|
RUN chmod +x /app/run.sh
|
|
|
|
|
|
|
|
CMD ["/app/run.sh"]
|