From 4749c6dd1386bf8fa8ba6fe7fe12f9d5224ad707 Mon Sep 17 00:00:00 2001 From: remyvdwereld <86827854+remyvdwereld@users.noreply.github.com> Date: Sat, 22 Jul 2023 23:17:59 +0200 Subject: [PATCH] Changed Dockerfile --- Dockerfile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b93eccc8c..77bcd9fe6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# Use the official Node.js image as the builder stage FROM node:16-alpine AS builder ARG COMMIT_HASH @@ -11,6 +12,9 @@ RUN mkdir -p $DIR/builds/production WORKDIR $DIR +# Install ca-certificates to handle SSL certificate verification +RUN apk add --no-cache ca-certificates + # install dependencies RUN npm ci --production --unsafe-perm --ignore-scripts . @@ -25,12 +29,17 @@ RUN mv $DIR/build/* $DIR/builds/production/ RUN npm run build:acc RUN mv $DIR/build/* $DIR/builds/acceptance/ +# Use the official Nginx image as the final stage FROM nginx:stable-alpine -ADD nginx.conf /etc/nginx/nginx.conf - -RUN apk add --no-cache ca-certificates +# Install libx11 for Nginx (if needed) RUN apk update && apk add --no-cache libx11 +# Copy the nginx configuration +ADD nginx.conf /etc/nginx/nginx.conf + +# Copy the build artifacts from the builder stage COPY --from=builder /var/www/builds /var/www + +# Start nginx CMD nginx -g 'daemon off;'