Skip to content

Commit

Permalink
added docker file
Browse files Browse the repository at this point in the history
Signed-off-by: captain-Akshay <[email protected]>
  • Loading branch information
captain-Akshay committed Sep 28, 2023
1 parent d40d88a commit ad9618c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.next
.github
24 changes: 24 additions & 0 deletions Dockerfile
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"]
19 changes: 19 additions & 0 deletions Dockerfile.dev
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"]

0 comments on commit ad9618c

Please sign in to comment.