29 lines
1.4 KiB
Docker
29 lines
1.4 KiB
Docker
# ipx-play (#447), the pages shared episodes open. Built from the repo's root:
|
|
# sh scripts/build-image.sh play
|
|
FROM rust:1-slim-trixie AS build
|
|
# SQLite is compiled from source for sqlx, which needs a C toolchain.
|
|
RUN apt-get update && apt-get install -y --no-install-recommends build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
WORKDIR /src
|
|
# Every member of the workspace, since cargo reads them all to build one.
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY crates ./crates
|
|
# The logo and icon its pages serve, compiled into the binary.
|
|
COPY web/logo.svg web/logo-dark.svg web/favicon.png ./web/
|
|
# Compiled crates kept in the builder between builds (#438), in a target of its own.
|
|
RUN --mount=type=cache,id=ipx-cargo-registry,target=/usr/local/cargo/registry,sharing=locked \
|
|
--mount=type=cache,id=ipx-play-target,target=/src/target,sharing=locked \
|
|
touch crates/play/src/main.rs crates/play/src/lib.rs crates/directory/src/lib.rs crates/feed/src/lib.rs \
|
|
&& cargo build --release --locked -p ipx-play \
|
|
&& cp target/release/ipx-play /usr/local/bin/ipx-play
|
|
|
|
FROM debian:trixie-slim
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=build /usr/local/bin/ipx-play /usr/local/bin/ipx-play
|
|
ENV PLAY_CONFIG=/config/play.toml
|
|
# Unraid's nobody:users. It writes nothing to disk: the database is elsewhere.
|
|
USER 99:100
|
|
EXPOSE 8102
|
|
CMD ["ipx-play"]
|