-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (25 loc) · 816 Bytes
/
Dockerfile
File metadata and controls
49 lines (25 loc) · 816 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node:24-alpine AS base
RUN apk add --no-cache git
FROM base AS deps
WORKDIR /build
COPY package.json pnpm-lock.yaml ./
RUN npm i -g pnpm
RUN pnpm i --frozen-lockfile
COPY . .
FROM deps AS builder
ARG SKIP_ENV_VALIDATION=1
# Set using `docker build --build-arg NEXT_PUBLIC_API_URL=<slugs> ...`
ARG NEXT_PUBLIC_ALLOWED_GROUP_SLUGS
RUN pnpm build
RUN pnpm prune --prod
FROM base AS runner
WORKDIR /app
RUN addgroup -S app && adduser -S app -G app
COPY --from=builder --chown=app:app /build/.next ./.next
COPY --from=builder --chown=app:app /build/public ./public
COPY --from=builder --chown=app:app /build/package.json ./package.json
COPY --from=builder --chown=app:app /build/node_modules ./node_modules
USER app
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node_modules/.bin/next", "start"]