Add Dockerfile
This commit is contained in:
27
Dockerfile
Normal file
27
Dockerfile
Normal 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"]
|
||||
|
||||
|
Reference in New Issue
Block a user