-
-
Notifications
You must be signed in to change notification settings - Fork 132
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (31 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
47 lines (31 loc) · 1.01 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
ARG ALPINE_VERSION=3.21
ARG NODE_VERSION=22.16.0
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS base
ENV SKIP_ENV_VALIDATION="true"
ENV DOCKER_OUTPUT=1
ENV NEXT_TELEMETRY_DISABLED=1
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
RUN apk update && apk add --no-cache libc6-compat
WORKDIR /app
RUN npm i -g corepack@latest && corepack enable
COPY package.json pnpm-lock.yaml prisma/ ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS release
ARG APP_VERSION
ENV NODE_ENV=production
ENV DOCKER_OUTPUT=1
WORKDIR /app
RUN apk update \
&& apk add --no-cache libc6-compat \
&& rm -rf /var/cache/apk/*
COPY --from=base /app/.next/standalone ./
COPY --from=base /app/.next/static ./.next/static
COPY --from=base /app/public ./public
COPY --from=base /app/prisma/migrations ./prisma/migrations
# set this so it throws error where starting server
ENV SKIP_ENV_VALIDATION="false"
ENV APP_VERSION=${APP_VERSION}
COPY ./start.sh ./start.sh
CMD ["sh", "start.sh"]