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;'