-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
37 lines (26 loc) · 878 Bytes
/
Dockerfile
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
# 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=22-slim
FROM node:${VARIANT} as build
ENV PNPM_HOME="/pnm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /frontend
# Prepare the build environment
COPY . .
RUN pnpm install && pnpm build
# Runtime
ARG VARIANT=22-slim
FROM node:${VARIANT}
WORKDIR /frontend
COPY --from=build /frontend/next.config.js .
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