From cd81f4d5c6268a5f6c4e327636a7e3cfedec9f45 Mon Sep 17 00:00:00 2001 From: Olwe Samuel Date: Wed, 4 Dec 2024 20:03:13 +0300 Subject: [PATCH] Add js files to image build --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2bff315..ed3ea6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,14 +28,13 @@ RUN --mount=type=cache,target=/root/.cache/pip pip3 install --user --requirement # === FROM node:18 AS yarn-dependencies WORKDIR /srv -ADD package.json . +ADD . . RUN --mount=type=cache,target=/usr/local/share/.cache/yarn yarn install # Build stage: Run "yarn run build-css" # === -FROM yarn-dependencies AS build-css -ADD static/sass static/sass -RUN yarn run build-css +FROM yarn-dependencies AS build +RUN yarn build # Build the production image # === @@ -49,7 +48,8 @@ WORKDIR /srv # Import code, build assets and mirror list ADD . . RUN rm -rf package.json yarn.lock requirements.txt -COPY --from=build-css /srv/static/css static/css +COPY --from=build /srv/static/css static/css +COPY --from=build /srv/static/js/dist static/js/dist # Set revision ID ARG BUILD_ID