Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Dockerfile #2205

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;'