Skip to content

Commit a03bfe8

Browse files
committed
add minimal docker setup
1 parent c6e0748 commit a03bfe8

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Dockerfile
2+
.dockerignore
3+
node_modules
4+
npm-debug.log
5+
README.md
6+
.next
7+
.git

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM node:16-bookworm AS base
2+
3+
FROM base AS deps
4+
5+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6+
7+
WORKDIR /app
8+
9+
COPY package.json yarn.lock* ./
10+
RUN yarn --frozen-lockfile
11+
12+
FROM base AS builder
13+
14+
WORKDIR /app
15+
COPY --from=deps /app/node_modules ./node_modules
16+
COPY . .
17+
18+
ENV NEXT_TELEMETRY_DISABLED 1
19+
RUN yarn run build
20+
21+
FROM base AS runner
22+
23+
WORKDIR /app
24+
25+
RUN adduser --uid 1001 nextjs
26+
27+
COPY --from=builder --chown=nextjs:node /app/ /app/
28+
29+
ENV NEXT_TELEMETRY_DISABLED 1
30+
ENV NODE_ENV production
31+
32+
USER nextjs
33+
34+
EXPOSE 3000
35+
36+
ENV PORT 3000
37+
38+
CMD ["yarn", "run", "start"]

0 commit comments

Comments
 (0)