-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (28 loc) · 752 Bytes
/
Dockerfile
File metadata and controls
32 lines (28 loc) · 752 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
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
RUN npm ci
COPY . .
# Accept build arguments for environment variables
ARG PUBLIC_OBP_BASE_URL
ARG OBP_OAUTH_CLIENT_ID
ARG OBP_OAUTH_CLIENT_SECRET
ARG APP_CALLBACK_URL
ARG ORIGIN
# Set environment variables for build
ENV PUBLIC_OBP_BASE_URL=$PUBLIC_OBP_BASE_URL
ENV OBP_OAUTH_CLIENT_ID=$OBP_OAUTH_CLIENT_ID
ENV OBP_OAUTH_CLIENT_SECRET=$OBP_OAUTH_CLIENT_SECRET
ENV APP_CALLBACK_URL=$APP_CALLBACK_URL
ENV ORIGIN=$ORIGIN
RUN npm run build
RUN npm prune --production
FROM node:22-alpine
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
EXPOSE 3003
ENV NODE_ENV=production
CMD [ "node", "build" ]