forked from eclipse-sw360/sw360-frontend
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 964 Bytes
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 964 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
# syntax=docker/dockerfile:1.4
# Copyright (c) Helio Chissini de Castro, 2023. Part of the SW360 Frontend Project.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
# SPDX-License-Identifier: EPL-2.0
# License-Filename: LICENSE
ARG VARIANT=24-slim
FROM node:${VARIANT} AS build
RUN npm install -g pnpm
WORKDIR /frontend
# Prepare the build environment
COPY . .
# define build-time args
ARG NEXT_PUBLIC_SW360_API_URL
ARG NEXTAUTH_URL
ARG AUTH_SECRET
RUN pnpm install
RUN pnpm build --experimental-analyze --turbo --profile
# Runtime
ARG VARIANT=24-slim
FROM node:${VARIANT}
WORKDIR /frontend
COPY --from=build /frontend/next.config.ts .
COPY --from=build /frontend/public ./public
COPY --from=build /frontend/.next/standalone ./
COPY --from=build /frontend/.next/static ./.next/static
CMD ["node", "server.js"]
EXPOSE 3000