Skip to content

Commit 6daf3c9

Browse files
committed
Dockerfile to containerize frontend
1 parent 2a6adf0 commit 6daf3c9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM node:18 AS builder
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json ./
6+
RUN npm install
7+
8+
COPY . .
9+
10+
RUN npm run build
11+
12+
FROM node:18-alpine
13+
14+
WORKDIR /app
15+
16+
COPY --from=builder /app/package.json /app/package-lock.json ./
17+
RUN npm install --omit=dev
18+
19+
COPY --from=builder /app/.next /app/.next
20+
COPY --from=builder /app/public /app/public
21+
COPY --from=builder /app/node_modules /app/node_modules
22+
23+
ENV NODE_ENV=dev
24+
25+
EXPOSE 3000
26+
27+
CMD npm run start

0 commit comments

Comments
 (0)