forked from eclipse-sw360/sw360-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 938 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
# 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-alpine
FROM node:${VARIANT} as build
WORKDIR /frontend
# Prepare the build environment
COPY package.json .
RUN npm install
COPY . .
RUN npm run build --production
# Runtime
ARG VARIANT=20-alpine
FROM node:${VARIANT}
WORKDIR /frontend
COPY --from=build /frontend/package.json .
COPY --from=build /frontend/package-lock.json .
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