-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (22 loc) · 859 Bytes
/
Dockerfile
File metadata and controls
35 lines (22 loc) · 859 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
ARG NODE_VERSION=22-alpine
FROM node:${NODE_VERSION}
ARG NODE_ENV=production
ARG NEXT_PUBLIC_API_URL=http://localhost:3000
ARG NEXT_PUBLIC_CAS_SERVICE_URL=http://localhost:3000
ARG NEXT_PUBLIC_API_VERSION=v1
ARG NEXT_PUBLIC_API_REQUEST_TIMEOUT=10000
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
ENV NEXT_PUBLIC_CAS_SERVICE_URL=${NEXT_PUBLIC_CAS_SERVICE_URL}
ENV NEXT_PUBLIC_API_VERSION=${NEXT_PUBLIC_API_VERSION}
ENV NEXT_PUBLIC_API_REQUEST_TIMEOUT=${NEXT_PUBLIC_API_REQUEST_TIMEOUT}
WORKDIR /usr/src/app
# Add alpine dependencies for 'sharp'
RUN apk add --upgrade --no-cache vips-dev build-base
COPY --chown=node:node package.json pnpm-lock.yaml ./
RUN npm i -g pnpm && pnpm install --frozen-lockfile --prod=false
COPY --chown=node:node . .
RUN pnpm next build
ENV NODE_ENV production
RUN pnpm install -P
USER node
CMD pnpm next start -p 8080