forked from binusgdc/Website2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (25 loc) · 717 Bytes
/
Dockerfile
File metadata and controls
30 lines (25 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ARG PORT=3000
FROM node:18-alpine3.16 AS base
FROM base AS dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
FROM base AS build
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=dependencies /app/node_modules ./node_modules
COPY public ./public
COPY src ./src
COPY package.json package-lock.json ./
COPY next.config.js postcss.config.js tailwind.config.js tsconfig.json _redirects ./
RUN npm run build
FROM base AS run
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=build /app/public ./public
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
EXPOSE $PORT
ENV PORT $PORT
ENTRYPOINT [ "node", "server.js" ]