From 720bccc89b188aa20757cee5947f0eb7929dd19c Mon Sep 17 00:00:00 2001 From: minottic Date: Tue, 31 Oct 2023 15:04:15 +0100 Subject: [PATCH] Add browser installation to fe Dockerfile --- dev/config/frontend/Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dev/config/frontend/Dockerfile b/dev/config/frontend/Dockerfile index 6bec3ff..f492ac7 100644 --- a/dev/config/frontend/Dockerfile +++ b/dev/config/frontend/Dockerfile @@ -1,14 +1,22 @@ FROM node:16 AS installer +WORKDIR /frontend +COPY package*.json /frontend/ +RUN npm ci +COPY . /frontend/ # A browser is needed for automated tests RUN apt-get update && apt-get install -y chromium ENV CHROME_BIN=/usr/bin/chromium ENV CHROME_PATH=/usr/lib/chromium/ +FROM node:16 AS builder WORKDIR /frontend -COPY package*.json /frontend/ +COPY --from=installer /frontend /frontend -RUN npm ci +RUN npx ng build -EXPOSE 4200 -CMD ["node serve"] \ No newline at end of file +FROM nginx:1.12-alpine +RUN rm -rf /usr/share/nginx/html/* +COPY --from=builder /frontend/dist/ /usr/share/nginx/html/ +COPY scripts/nginx.conf /etc/nginx/nginx.conf +EXPOSE 80