2020-08-14 23:13:34 +00:00
|
|
|
# build environment
|
2024-07-17 14:46:44 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM node:22.2.0-alpine3.18 as build-stage
|
2020-08-24 01:08:44 +00:00
|
|
|
RUN mkdir /app && chown -R node:node /app
|
2020-08-14 23:13:34 +00:00
|
|
|
WORKDIR /app
|
2020-09-19 20:14:33 +00:00
|
|
|
RUN apk add --no-cache python3 make g++
|
2020-09-01 00:05:56 +00:00
|
|
|
USER node
|
2023-09-25 23:11:43 +00:00
|
|
|
COPY --link --chown=1000:1000 package*.json ./
|
2020-08-31 22:55:14 +00:00
|
|
|
RUN SKIP_BUILD=true npm ci
|
2023-09-25 23:11:43 +00:00
|
|
|
COPY --link --chown=1000:1000 . .
|
2020-08-14 23:13:34 +00:00
|
|
|
|
2020-08-27 23:22:46 +00:00
|
|
|
ARG SERVERS
|
2020-08-30 20:05:37 +00:00
|
|
|
ARG VERSION
|
2020-08-14 23:13:34 +00:00
|
|
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# production environment
|
2024-05-31 11:52:34 +00:00
|
|
|
FROM nginx:1.27.0-alpine as production-stage
|
2020-11-19 02:18:30 +00:00
|
|
|
COPY --chown=nginx:nginx --from=build-stage /app/dist /usr/share/nginx/html
|