-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (33 loc) · 1 KB
/
Dockerfile
File metadata and controls
52 lines (33 loc) · 1 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM node:24 AS base
FROM base AS deps
ARG GA_NPM_TOKEN
WORKDIR /deps
COPY .npmrc package*.json ./
RUN npm ci
FROM base AS build
ENV NEXT_TELEMETRY_DISABLED 1
WORKDIR /build
COPY --from=deps /deps/node_modules ./node_modules
COPY . .
RUN npm run build
FROM base AS application
WORKDIR /app
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
jq \
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/*
COPY --from=build /build/next.config.js ./
COPY --from=build /build/.next ./.next
COPY --from=build /build/public ./public
COPY --from=build /build/node_modules ./node_modules
COPY --from=build /build/package.json ./package.json
COPY --from=build /build/entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
FROM application AS development
EXPOSE 3000
ENTRYPOINT ["./entrypoint.sh"]
CMD ["npm", "run", "dev"]
FROM application AS production
EXPOSE 3000
ENTRYPOINT ["./entrypoint.sh"]
CMD ["npm", "run", "start"]