Skip to content

Commit

Permalink
dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cycle-five committed Sep 12, 2024
1 parent 5580816 commit dbd8eff
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ FROM rust:1.80.1-alpine AS builder

# Install build dependencies
# RUN apk add --no-cache build-base musl-dev openssl-dev openssl cmake
RUN apk add --no-cache build-base musl-dev cmake
RUN apk add --no-cache \
build-base=0.5-r3 \
musl-dev=1.2.5-r0 \
cmake=3.29.3-r0 \
git=2.45.2-r0

# Default directory
WORKDIR /app
Expand All @@ -15,7 +19,7 @@ WORKDIR /app
# Copy all the files
COPY . .

RUN cargo build --no-default-features --features crack-tracing -p cracktunes --profile=dist
RUN cargo build -p cracktunes --profile=dist

# STAGE2: create a slim image with the compiled binary
FROM alpine AS runner
Expand All @@ -24,14 +28,16 @@ FROM alpine AS runner
WORKDIR /app

# RUN apk add --no-cache ffmpeg curl
RUN apk add --no-cache ffmpeg curl
RUN apk add --no-cache \
ffmpeg \
curl

ADD ./data /data
RUN curl -sSL --output /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux \
&& chmod +x /usr/local/bin/yt-dlp
&& chmod +x /usr/local/bin/yt-dlp
# Copy the binary from the builder stage
COPY --from=builder /app/target/dist/cracktunes /app/app
# Copy the start script from the builder stage
COPY --from=builder /app/scripts/start.sh /app/start.sh

CMD ["/app/start.sh"]
CMD ["/app/start.sh"]

0 comments on commit dbd8eff

Please sign in to comment.