-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUI.Dockerfile
More file actions
43 lines (30 loc) · 1.16 KB
/
UI.Dockerfile
File metadata and controls
43 lines (30 loc) · 1.16 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
# SPDX-FileCopyrightText: 2024 Double Open Oy
#
# SPDX-License-Identifier: MIT
FROM node:24.15.0 AS base
FROM base AS builder
WORKDIR /app
RUN npm i -g turbo
COPY . .
RUN turbo prune clearance_ui --docker
FROM base AS installer
WORKDIR /app
COPY --from=builder /app/out/json/ .
RUN npm install
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL $NEXT_PUBLIC_API_URL
COPY --from=builder /app/out/full/ .
RUN npm exec turbo build --filter=clearance_ui...
FROM base AS runner
WORKDIR /app
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/clearance_ui/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/clearance_ui/.next/static ./apps/clearance_ui/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/clearance_ui/public ./apps/clearance_ui/public
# server.js is created by `next build` from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["node", "apps/clearance_ui/server.js"]