-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from yash-chudasama/main
Docker Support
- Loading branch information
Showing
2 changed files
with
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Stage 1: Build the NextJS Application | ||
FROM node:20-alpine as build | ||
WORKDIR /app | ||
COPY package*.json ./ | ||
RUN npm ci | ||
COPY . . | ||
RUN npm run build | ||
|
||
# Stage 2: Setup the Nginx Server to serve the NextJS Application | ||
FROM nginx:stable-alpine3.17 as production | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
RUN echo 'server { listen 80; server_name _; root /usr/share/nginx/html; location / { try_files $uri /index.html; } }' > /etc/nginx/conf.d/default.conf | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |
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