spacebot/Dockerfile
kittentm 5483ef3595
Some checks failed
Build and Test / splatie (push) Failing after 2m12s
👀
2026-05-17 17:55:38 +02:00

41 lines
No EOL
1.3 KiB
Docker

# syntax=docker/dockerfile:1
FROM rust:alpine AS chef
RUN apk add --no-cache openssl-dev musl-dev openssl-libs-static lld git g++ make
RUN cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
COPY . .
RUN git submodule update --init
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
ENV OPENSSL_LIB_DIR=/usr/lib
ENV OPENSSL_INCLUDE_DIR=/usr/include/openssl
ENV OPENSSL_STATIC=1
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo chef cook --release --recipe-path recipe.json --target x86_64-unknown-linux-musl
COPY . .
RUN git submodule update --init
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release --target x86_64-unknown-linux-musl && \
mkdir -p /app/dist && \
cp /app/target/x86_64-unknown-linux-musl/release/professor /app/dist/
FROM alpine:latest AS final
WORKDIR /app
RUN apk add --no-cache ffmpeg python3 curl libstdc++ \
&& curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp \
&& chmod a+rx /usr/local/bin/yt-dlp \
&& apk del curl
COPY --from=builder /app/dist/professor ./splatie
ENTRYPOINT ["./splatie"]