-
-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: captain-Akshay <[email protected]>
- Loading branch information
1 parent
d40d88a
commit ad9618c
Showing
3 changed files
with
46 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,3 @@ | ||
node_modules | ||
.next | ||
.github |
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,24 @@ | ||
# Production Docker file | ||
FROM node:18-alpine as builder | ||
|
||
WORKDIR /async | ||
|
||
COPY package.json package-lock.json scripts ./ | ||
|
||
RUN npm ci | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
FROM node:18-alpine AS PRODUCTION_STAGE | ||
WORKDIR /async | ||
|
||
COPY --from=builder /async/package*.json ./ | ||
COPY --from=builder /async/scripts ./ | ||
COPY --from=builder /async/.next ./.next | ||
COPY --from=builder /async/public ./public | ||
COPY --from=builder /async/node_modules ./node_modules | ||
|
||
ENV NODE_ENV=production | ||
EXPOSE 3000 | ||
CMD ["npm", "start"] |
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,19 @@ | ||
# Development Docker file | ||
FROM node:18-alpine as development | ||
|
||
WORKDIR /async | ||
|
||
# Install development dependencies | ||
COPY package.json package-lock.json ./ | ||
RUN npm install | ||
|
||
# Copy the rest of the application files | ||
COPY . . | ||
|
||
# Expose the port for development (if needed) | ||
EXPOSE 3000 | ||
|
||
# Set environment variables for development (optional) | ||
ENV NODE_ENV=development | ||
|
||
CMD ["npm", "run", "dev"] |