MSP-4561 update Dockerfile

This commit is contained in:
foxxy committed 2024-12-13 13:07:30 +03:00
1 parent 425096da54
commit 358cc06e94
2 files changed
+23 -8

No files matched your search

+22 -7
View File
@@ -1,13 +1,28 @@
FROM node:20-alpine as build-deps
ARG NODE_VERSION=lts
FROM node:${NODE_VERSION}-alpine as base
WORKDIR /usr/src/app
COPY . ./
RUN apk add git
RUN npm install
FROM base as deps
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci --omit=dev
FROM deps as build
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci
COPY . .
RUN npm run build
FROM nginx:1.25-alpine-slim
EXPOSE 8001
FROM nginx:alpine-slim as final
RUN rm -f /etc/nginx/conf.d/default.conf
COPY cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf
COPY --from=build-deps /usr/src/app/build /opt/msp/isp-admin-ui
COPY --from=build /usr/src/app/build /opt/msp/isp-admin-ui
+1 -1
View File
@@ -11,7 +11,7 @@
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
"lint:fix": "eslint --fix .",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"prepare": "husky install"
"prepare": "husky || true"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.6",