scel/Dockerfile
Kasper Juul Hermansen b8ffc3f951
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
chore(deps): update all dependencies
2024-05-18 12:19:47 +00:00

32 lines
936 B
Docker

FROM node:22-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.78 as builder
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
COPY --from=web_builder /usr/src/scel/web/dist /src/web/dist
CMD ["scel"]