Browse Source

Docker speedbuild

pull/14/head
Nicolai Ort 7 months ago
parent
commit
36ce64a79d
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
  1. 24
      .drone.yml
  2. 9
      Dockerfile

24
.drone.yml

@ -12,6 +12,20 @@ get:
path: odit-registry-builder
name: password
---
kind: secret
name: npmjs_domain
get:
path: odit-npm-bot
name: domain
---
kind: secret
name: npmjs_token
get:
path: odit-npm-bot
name: token
---
kind: pipeline
type: kubernetes
@ -30,6 +44,11 @@ steps:
tags:
- latest
registry: registry.odit.services
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
mtu: 1000
when:
branch:
@ -53,6 +72,11 @@ steps:
tags:
- '${DRONE_TAG}'
registry: registry.odit.services
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
mtu: 1000
trigger:
event:

9
Dockerfile

@ -1,14 +1,15 @@
FROM registry.odit.services/hub/library/node:17.0.1-alpine3.14
ARG NPM_REGISTRY_DOMAIN=registry.npmjs.org
ARG NPM_REGISTRY_TOKEN=null
WORKDIR /app
COPY package.json .
# COPY yarn.lock .
RUN yarn --production --frozen-lockfile
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
COPY migrations ./migrations
COPY src ./src
COPY knexfile.js ./
RUN mkdir db
#
# FROM astefanutti/scratch-node:16.0.0
FROM registry.odit.services/hub/library/node:17.0.1-alpine3.14
WORKDIR /app
COPY --from=0 /app /app

Loading…
Cancel
Save