Spaces:
Sleeping
Sleeping
File size: 662 Bytes
61ff1f0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# Use the official Rust image as the base image
FROM rust:latest AS builder
# Create a new empty shell project
RUN USER=root cargo new --bin spotify
WORKDIR /spotify
# Copy the Cargo.toml and Cargo.lock files
COPY Cargo.toml Cargo.lock ./
# Copy the source code
COPY src ./src
# Build the application in release mode
RUN cargo build --release
# Use the official Debian image as the base image for the runtime
FROM debian:buster-slim
# Copy the compiled binary from the builder stage
COPY --from=builder /spotify/target/release/spotify /usr/local/bin/spotify
# Expose port 7860
EXPOSE 7860
# Run the application
CMD ["spotify"]
|