Files
ISA-Frontend/Dockerfile
Lorenz Hilpert 337ef46acb Updated .gitignore and Dockerfile for improved build process.
- 🛠️ **Refactor**: Changed npm install command in Dockerfile for better script handling
- 🗑️ **Chore**: Removed junit.xml from repository
- 🎨 **Style**: Added junit.xml to .gitignore for cleaner project structure
- 🎨 **Style**: Ensured newline at end of file in .gitignore
2025-04-25 12:06:15 +02:00

30 lines
959 B
Docker

#stage 1
FROM node:22 as base
ARG IS_PRODUCTION=false
ARG SEMVERSION=1.0.0
ARG BuildUniqueID
LABEL build.uniqueid="${BuildUniqueID:-1}"
WORKDIR /app
COPY . .
RUN umask 0022
RUN npm version ${SEMVERSION}
RUN npm install --foreground-scripts
RUN if [ "${IS_PRODUCTION}" = "true" ] ; then npm run-script build-prod ; else npm run-script build ; fi
# stage final
FROM nginx:alpine as publish
ARG BuildUniqueID
LABEL build.uniqueid="${BuildUniqueID:-1}"
COPY --from=base /app/dist/isa-app /usr/share/nginx/html
COPY --from=base /app/nginx.conf /etc/nginx/conf.d/default.conf
# stage npm test
FROM base as test
ARG BuildUniqueID
LABEL build.uniqueid="${BuildUniqueID:-1}"
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -q -O /tmp/chrome.deb && apt update && apt install -y /tmp/chrome.deb
# ignore exitcode, sonst gibts keinen container
RUN npm run ci || true
ENTRYPOINT [ "/bin/sleep", "60000" ]