-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (20 loc) · 999 Bytes
/
Dockerfile
File metadata and controls
23 lines (20 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Minimize the size and complexity of the final Docker image by separating the
# build stage and the runtime stage into two different steps
# Stage 1: Build the Next.js application
FROM --platform=$BUILDPLATFORM node:24-alpine AS build
WORKDIR /app
# Copy the package.json and package-lock.json files to the working directory
COPY package*.json ./
COPY packages/diracx-web/package*.json ./packages/diracx-web/
COPY packages/diracx-web-components/package*.json ./packages/diracx-web-components/
# Install the project dependencies
RUN npm ci && npm cache clean --force
# Copy the application to the working directory
COPY . .
# Build the static export with telemetry disabled (https://nextjs.org/telemetry)
RUN NEXT_TELEMETRY_DISABLED=1 npm run build
# Stage 2: Copy the website from the previous container to a Nginx container
FROM nginxinc/nginx-unprivileged:1.29-alpine
EXPOSE 8080
COPY --from=build /app/out /usr/share/nginx/html
COPY ./config/nginx/default.conf /etc/nginx/conf.d/default.conf