-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DockerFile): updated Docker file
- Loading branch information
Aman Agarwal
authored and
Aman Agarwal
committed
Dec 13, 2023
1 parent
e3dc695
commit e452478
Showing
5 changed files
with
60 additions
and
3 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,40 @@ | ||
# Stage 1: Build Stage | ||
FROM node:18-alpine AS build | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code to the container | ||
COPY . . | ||
COPY .env.example ./env.local | ||
|
||
# Build the Next.js app | ||
RUN npm run build | ||
|
||
# Stage 2: Runtime Stage | ||
FROM node:18-alpine | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy only necessary files from the build stage | ||
ENV NODE_ENV production | ||
|
||
COPY --from=build /app/next.config.js ./next.config.js | ||
COPY --from=build /app/public ./public | ||
COPY --from=build /app/package.json ./package.json | ||
COPY --from=build /app/.next/standalone ./ | ||
COPY --from=build /app/.next/static ./.next/static | ||
COPY .env.example ./env.local | ||
|
||
# Expose the desired port | ||
EXPOSE 3400 | ||
|
||
# Start the Next.js app | ||
CMD ["node", "server.js"] |
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,15 @@ | ||
version: '3' | ||
|
||
services: | ||
marketplace-ui: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "3400:3000" | ||
networks: | ||
- samagra_compass | ||
|
||
networks: | ||
samagra_compass: | ||
external: true |
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