Skip to content

Commit

Permalink
🤖 Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Irori235 committed Oct 14, 2023
1 parent 26625d5 commit b904f10
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:20 AS base

WORKDIR /app
COPY ./package.json ./yarn.lock ./
RUN yarn install --frozen-lockfile --production
COPY . .

FROM base AS builder

WORKDIR /app
RUN yarn build

FROM gcr.io/distroless/nodejs20

WORKDIR /app

# Copy artifacts
COPY ./next.config.js .
COPY ./.next ./.next

# Copy node_modules
COPY --from=base /app/node_modules ./node_modules

# Copy build
COPY --from=builder /app/.next ./.next
EXPOSE 3000
CMD ["./node_modules/next/dist/bin/next", "start"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:
docker build . -t portfolio

run:
docker run -p 3000:3000 portfolio

1 comment on commit b904f10

@vercel
Copy link

@vercel vercel bot commented on b904f10 Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.