2022-10-22 20:43:13 +00:00
|
|
|
FROM rust:slim as BUILD
|
|
|
|
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2022-10-23 16:56:19 +00:00
|
|
|
build-essential pkg-config libssl-dev libpq-dev && \
|
2022-10-22 20:43:13 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
WORKDIR /app/
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
|
|
--mount=type=cache,target=/app/target/ \
|
|
|
|
cargo build --release && \
|
|
|
|
mv target/release/sponsorblock-mirror .
|
|
|
|
|
|
|
|
FROM debian:stable-slim
|
|
|
|
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2022-10-23 16:56:19 +00:00
|
|
|
libssl1.1 libpq5 ca-certificates && \
|
2022-10-22 20:43:13 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
WORKDIR /app/
|
|
|
|
|
|
|
|
COPY --from=BUILD /app/sponsorblock-mirror .
|
|
|
|
COPY --from=BUILD /app/Rocket.toml .
|
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
CMD ["/app/sponsorblock-mirror"]
|