chore: speed up build (#4017)

* better cache dependencies

* ignore local statik.go

* remove previously generated statik.go file

* remove redundant .dockerignore
This commit is contained in:
Elio Bischof
2022-07-25 13:54:05 +02:00
committed by GitHub
parent ccde49b323
commit 6bb3220186
3 changed files with 18 additions and 12 deletions

View File

@@ -3,10 +3,16 @@ ARG NODE_VERSION=16
#######################
## With this step we prepare all node_modules, this helps caching the build
## Speed up this step by mounting your local node_modules directory
## We also copy and generate the source code
#######################
FROM node:${NODE_VERSION} as npm-base
WORKDIR /console
# Dependencies
COPY console/package.json console/package-lock.json ./
RUN npm ci
# Sources
COPY console .
COPY --from=zitadel-base:local /proto /proto
COPY --from=zitadel-base:local /usr/local/bin /usr/local/bin/.
@@ -24,12 +30,8 @@ COPY --from=npm-base /console/src/app/proto/generated /console/src/app/proto/gen
#######################
FROM npm-base as angular-build
COPY console/package.json console/package-lock.json ./
RUN npm ci
RUN npm run lint
RUN npm run prodbuild
RUN ls -la /console/dist/console
#######################
## Only Copy Assets