forked from w3f/1k-validators-be
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce Docker image size, set error handler in build script
- Loading branch information
1 parent
ee1eee5
commit 987814c
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
FROM node:21-slim AS builder | ||
ARG MATRIX_TOKEN | ||
ARG PACKAGE | ||
ENV PACKAGE ${PACKAGE} | ||
WORKDIR /code | ||
COPY . . | ||
RUN echo "building ${PACKAGE}... "; \ | ||
RUN set -e; \ | ||
echo "building ${PACKAGE}... "; \ | ||
yarn install; \ | ||
echo "yarn install done. Building...." ; \ | ||
yarn build; \ | ||
echo "building ${PACKAGE} done."; \ | ||
apt-get update && \ | ||
apt-get clean | ||
|
||
FROM node:21-slim | ||
ARG PACKAGE | ||
ENV PACKAGE ${PACKAGE} | ||
WORKDIR /code | ||
COPY --from=builder /code/package.json . | ||
COPY --from=builder /code/yarn.lock . | ||
COPY --from=builder /code/node_modules . | ||
COPY --from=builder /code/packages/core/build/index.js ./packages/core/build/ | ||
CMD yarn run start:js:${PACKAGE} |