-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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 node:alpine AS build | ||
WORKDIR /app | ||
# Copy the application to the working directory | ||
COPY . . | ||
# Install the project dependencies | ||
RUN npm ci | ||
# 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:alpine | ||
EXPOSE 8080 | ||
COPY --from=build /app/out /usr/share/nginx/html | ||
COPY ./config/nginx/default.conf /etc/nginx/conf.d/default.conf |