2022-04-29 14:08:42 +02:00
|
|
|
ARG NODE_VERSION=16
|
2021-07-27 14:34:56 +02:00
|
|
|
|
|
|
|
#######################
|
|
|
|
## With this step we prepare all node_modules, this helps caching the build
|
|
|
|
## Speed up this step by mounting your local node_modules directory
|
2022-07-25 13:54:05 +02:00
|
|
|
## We also copy and generate the source code
|
2021-07-27 14:34:56 +02:00
|
|
|
#######################
|
|
|
|
FROM node:${NODE_VERSION} as npm-base
|
|
|
|
WORKDIR /console
|
|
|
|
|
2022-07-25 13:54:05 +02:00
|
|
|
# Dependencies
|
|
|
|
COPY console/package.json console/package-lock.json ./
|
|
|
|
RUN npm ci
|
|
|
|
|
|
|
|
# Sources
|
2021-07-27 14:34:56 +02:00
|
|
|
COPY console .
|
2022-02-14 15:35:16 +01:00
|
|
|
COPY --from=zitadel-base:local /proto /proto
|
|
|
|
COPY --from=zitadel-base:local /usr/local/bin /usr/local/bin/.
|
2021-07-27 14:34:56 +02:00
|
|
|
COPY build/console build/console/
|
|
|
|
RUN build/console/generate-grpc.sh
|
|
|
|
|
|
|
|
#######################
|
|
|
|
## copy for local dev
|
|
|
|
#######################
|
|
|
|
FROM scratch as npm-copy
|
2022-04-28 12:35:02 +02:00
|
|
|
COPY --from=npm-base /console/src/app/proto/generated /console/src/app/proto/generated
|
2021-07-27 14:34:56 +02:00
|
|
|
|
|
|
|
#######################
|
|
|
|
## angular lint workspace and prod build
|
|
|
|
#######################
|
2022-02-14 15:35:16 +01:00
|
|
|
FROM npm-base as angular-build
|
2022-04-28 12:35:02 +02:00
|
|
|
|
2021-07-27 14:34:56 +02:00
|
|
|
RUN npm run lint
|
|
|
|
RUN npm run prodbuild
|
|
|
|
|
|
|
|
#######################
|
|
|
|
## Only Copy Assets
|
|
|
|
#######################
|
2022-02-14 15:35:16 +01:00
|
|
|
FROM scratch as angular-export
|
|
|
|
COPY --from=angular-build /console/dist/console .
|