-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (25 loc) · 770 Bytes
/
Dockerfile
File metadata and controls
31 lines (25 loc) · 770 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
# build
FROM node:24.7-alpine AS build
ARG SAGE_UI_APP=sage
ARG SAGE_UI_PROJECT
ARG SAGE_UI_SERVICE_CONFIG
ARG MAPBOX_TOKEN
ENV SAGE_UI_PROJECT=${SAGE_UI_PROJECT}
ENV SAGE_UI_SERVICE_CONFIG=${SAGE_UI_SERVICE_CONFIG}
ENV MAPBOX_TOKEN=${MAPBOX_TOKEN}
WORKDIR /app
COPY apps/${SAGE_UI_APP}/package.json ./apps/${SAGE_UI_APP}/package.json
COPY package*.json .
RUN npm install -g npm@11.10.0
RUN npx update-browserslist-db@latest
RUN npm install -w ${SAGE_UI_APP} --omit=dev
COPY . .
RUN npm run build -w ${SAGE_UI_APP}
# server
FROM nginx:1.27.2-alpine
ARG SAGE_UI_APP=sage
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=build /app/apps/${SAGE_UI_APP}/dist/ /var/www/
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
ENTRYPOINT ["nginx", "-g", "daemon off;"]