Skip to content

Commit

Permalink
Merge pull request #2205 from Amsterdam/dockerfile/update
Browse files Browse the repository at this point in the history
Changed Dockerfile
  • Loading branch information
remyvdwereld authored Jul 22, 2023
2 parents 67d5a5f + 4749c6d commit afa63c0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Use the official Node.js image as the builder stage
FROM node:16-alpine AS builder

ARG COMMIT_HASH
Expand All @@ -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 .

Expand All @@ -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;'

0 comments on commit afa63c0

Please sign in to comment.