⚡️(docker) separate deps y-webrtc-signaling
We separate the install part of the signaling server from the frontend-dep stage. It will improve the build time of both of them.
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
FROM node:20 as frontend-deps
|
||||
FROM node:20-alpine as frontend-deps-y-webrtc-signaling
|
||||
|
||||
WORKDIR /home/frontend/
|
||||
|
||||
COPY ./src/frontend/package.json ./package.json
|
||||
COPY ./src/frontend/yarn.lock ./yarn.lock
|
||||
COPY ./src/frontend/apps/impress/package.json ./apps/impress/package.json
|
||||
COPY ./src/frontend/apps/y-webrtc-signaling/package.json ./apps/y-webrtc-signaling/package.json
|
||||
COPY ./src/frontend/packages/i18n/package.json ./packages/i18n/package.json
|
||||
COPY ./src/frontend/packages/eslint-config-impress/package.json ./packages/eslint-config-impress/package.json
|
||||
|
||||
RUN yarn install --frozen-lockfile
|
||||
RUN yarn install
|
||||
|
||||
COPY ./src/frontend/ .
|
||||
|
||||
@@ -17,7 +15,7 @@ COPY ./src/frontend/ .
|
||||
COPY ./docker/files/usr/local/bin/entrypoint /usr/local/bin/entrypoint
|
||||
|
||||
# ---- y-webrtc-signaling ----
|
||||
FROM frontend-deps as y-webrtc-signaling
|
||||
FROM frontend-deps-y-webrtc-signaling as y-webrtc-signaling
|
||||
|
||||
WORKDIR /home/frontend/apps/y-webrtc-signaling
|
||||
RUN yarn build
|
||||
@@ -30,6 +28,19 @@ ENTRYPOINT [ "/usr/local/bin/entrypoint" ]
|
||||
|
||||
CMD ["yarn", "start"]
|
||||
|
||||
FROM node:20-alpine as frontend-deps
|
||||
|
||||
WORKDIR /home/frontend/
|
||||
|
||||
COPY ./src/frontend/package.json ./package.json
|
||||
COPY ./src/frontend/yarn.lock ./yarn.lock
|
||||
COPY ./src/frontend/apps/impress/package.json ./apps/impress/package.json
|
||||
COPY ./src/frontend/packages/eslint-config-impress/package.json ./packages/eslint-config-impress/package.json
|
||||
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
COPY ./src/frontend/ .
|
||||
|
||||
### ---- Front-end builder image ----
|
||||
FROM frontend-deps as impress
|
||||
|
||||
|
||||
Reference in New Issue
Block a user