-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
49 lines (36 loc) · 1.17 KB
/
Dockerfile
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
FROM node:21-alpine AS base
WORKDIR /usr/app
COPY ./package.json \
./package-lock.json \
./next.config.mjs \
./tsconfig.json \
./reset.d.ts \
./tailwind.config.js \
./postcss.config.js ./
COPY ./scripts ./scripts
COPY ./prisma ./prisma
RUN apk add --no-cache openssl && \
npm ci --ignore-scripts && \
npx prisma generate
COPY ./src ./src
COPY ./messages ./messages
ENV NEXT_TELEMETRY_DISABLED=1
COPY scripts/build.env .env
RUN npm run build
RUN rm -r .next/cache
FROM node:21-alpine AS runtime-deps
WORKDIR /usr/app
COPY --from=base /usr/app/package.json /usr/app/package-lock.json /usr/app/next.config.mjs ./
COPY --from=base /usr/app/prisma ./prisma
RUN npm ci --omit=dev --omit=optional --ignore-scripts && \
npx prisma generate
FROM node:21-alpine AS runner
EXPOSE 3000/tcp
WORKDIR /usr/app
COPY --from=base /usr/app/package.json /usr/app/package-lock.json /usr/app/next.config.mjs ./
COPY --from=runtime-deps /usr/app/node_modules ./node_modules
COPY ./public ./public
COPY ./scripts ./scripts
COPY --from=base /usr/app/prisma ./prisma
COPY --from=base /usr/app/.next ./.next
ENTRYPOINT ["/bin/sh", "/usr/app/scripts/container-entrypoint.sh"]