Add Dockerfile

This commit is contained in:
2025-08-01 12:38:04 -04:00
parent fde8f3d7a3
commit c09494ba9b

27
Dockerfile Normal file
View File

@ -0,0 +1,27 @@
FROM rust:alpine AS builder
RUN rustup default nightly
RUN apk add --no-cache musl-dev
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && \
echo "fn main() {}" > src/main.rs && \
cargo build --release && \
rm -rf src
COPY src ./src
COPY html ./html
RUN cargo build --release
FROM scratch
COPY --from=builder /app/target/release/spotify-top-songs-playlist /spotify-top-songs-playlist
COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1
ENTRYPOINT ["/spotify-top-songs-playlist"]