From 5f90d663cf1b8c0edabc6a0065c6698c91c65176 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Mon, 18 Jul 2022 23:12:01 +0200 Subject: [PATCH] Add docker for web --- Dockerfile | 10 ++++++++++ src/web/.dockerignore | 1 + 2 files changed, 11 insertions(+) create mode 100644 src/web/.dockerignore diff --git a/Dockerfile b/Dockerfile index 366b1a6..8b6bb84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,12 @@ +FROM node:16-alpine as web_builder + +WORKDIR /usr/src/scel/web + +COPY src/web/ . + +RUN --mount=type=cache,target=/usr/src/scel/web/dist yarn +RUN --mount=type=cache,target=/usr/src/scel/web/dist yarn build + FROM rust:1.60 as builder WORKDIR /usr/src/scel @@ -17,5 +26,6 @@ RUN python3 -m pip install -U yt-dlp # Copy binary COPY --from=builder /usr/local/cargo/bin/scel /usr/local/bin/scel +COPY --from=web_builder /usr/src/scel/web/dist /src/web/dist CMD ["scel"] diff --git a/src/web/.dockerignore b/src/web/.dockerignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/src/web/.dockerignore @@ -0,0 +1 @@ +node_modules/