Switched to npm cache for build
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-03-17 15:38:46 +01:00
parent 3c94706fee
commit e5be5ae4d5
2 changed files with 14 additions and 6 deletions

View File

@@ -12,6 +12,13 @@ get:
path: odit-registry-builder
name: password
---
kind: secret
name: npm_url
get:
path: odit-npm-cache
name: url
---
kind: pipeline
type: kubernetes
@@ -25,10 +32,8 @@ steps:
password:
from_secret: docker_password
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
- NPM_REGISTRY_URL:
from_secret: npm_url
repo: lfk/docs
tags:
- latest

View File

@@ -1,10 +1,13 @@
FROM registry.odit.services/hub/library/node:16.15.1-alpine3.16 AS build
ARG NPM_REGISTRY_URL=https://registry.npmjs.org
WORKDIR /app
COPY package.json *.config.cjs *.config.js ./
RUN npm config set registry https://$NPM_REGISTRY_DOMAIN && npm config set //$NPM_REGISTRY_DOMAIN/:_authToken $NPM_REGISTRY_TOKEN
RUN npm i -g pnpm && pnpm i
RUN npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@7.29.3
RUN pnpm i
COPY . ./
RUN pnpm build
# final image
FROM registry.odit.services/library/nginx-brotli:3.15.130
COPY --from=build /app/src/.vuepress/dist /usr/share/nginx/html