2024-03-20 13:51:14 +01:00
|
|
|
FROM node:21-alpine as web_builder
|
2022-07-18 23:12:01 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-03-20 13:51:14 +01:00
|
|
|
FROM rust:1.76 as builder
|
2022-07-18 13:17:02 +02:00
|
|
|
|
|
|
|
WORKDIR /usr/src/scel
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN --mount=type=cache,target=/usr/src/scel/target cargo build --release
|
|
|
|
RUN --mount=type=cache,target=/usr/src/scel/target cargo install --path src/cmd/scel
|
|
|
|
|
|
|
|
FROM debian:bullseye-slim
|
|
|
|
|
|
|
|
# Install YTD
|
|
|
|
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
|
|
|
|
apt-get update && apt-get install -y python3 python3-pip
|
|
|
|
RUN python3 -m pip install -U yt-dlp
|
|
|
|
|
|
|
|
# Copy binary
|
|
|
|
COPY --from=builder /usr/local/cargo/bin/scel /usr/local/bin/scel
|
2022-07-18 23:12:01 +02:00
|
|
|
COPY --from=web_builder /usr/src/scel/web/dist /src/web/dist
|
2022-07-18 13:17:02 +02:00
|
|
|
|
|
|
|
CMD ["scel"]
|