add Dockerfile

This commit is contained in:
2024-02-16 14:55:15 +01:00
parent 5560d31638
commit 00247fb77b
3 changed files with 51 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
# Build image
FROM rust:slim-bullseye as build
RUN apt-get update && apt-get install -y \
build-essential autoconf automake cmake libtool libssl-dev pkg-config
WORKDIR "/app"
# Cache cargo build dependencies by creating a dummy source
RUN mkdir src
RUN echo "fn main() {}" > src/main.rs
COPY Cargo.toml ./
COPY Cargo.lock ./
RUN cargo build --release --locked
COPY . .
RUN cargo build --release --locked
# Release image
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y python3-pip ffmpeg
RUN pip install -U yt-dlp
COPY --from=build /app/target/release/djheuel .
CMD ["./djheuel"]