Files
pl8list-rewind/Dockerfile
T
nvrl b4470850bf Rebuild front end in TypeScript with a pager, crossfades and reactive visuals
The front end moves to web/ (Vite, TypeScript, no framework) and is built
into web/dist, which the server embeds. hls.js is bundled from npm and
loaded on demand instead of vendored.

The feed is a custom pager instead of CSS scroll snapping: drag and flick
with a spring that keeps the finger's speed, a rubber band at the ends,
one page per wheel or trackpad gesture, and only three cards in the DOM.

Playback uses two decks. The next track is buffered shortly after the
current one starts and tracks crossfade through a Web Audio graph; on iOS,
where that would break lock-screen playback, they switch with a cut. An
analyser drives a bass pulse of the artwork and its glow, and each card
takes its accent colour from the artist image. Styles start from design
tokens and respect reduced motion.

Docker gets a Node build stage; legal pages use their own small stylesheet.
2026-11-01 12:57:17 +01:00

35 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1
FROM node:24-alpine AS web
WORKDIR /src/web
COPY web/package.json web/package-lock.json ./
RUN npm ci
COPY web ./
RUN npm run build
FROM rust:1-alpine AS build
RUN apk add --no-cache musl-dev cmake make perl clang ca-certificates
WORKDIR /src/backend
COPY backend/Cargo.toml backend/Cargo.lock ./
# Build the dependencies once, so code changes don't rebuild them.
RUN mkdir src && echo 'fn main() {}' > src/main.rs \
&& cargo build --release --locked \
&& rm -rf src
COPY --from=web /src/web/dist /src/web/dist
COPY backend ./
RUN touch src/main.rs && cargo build --release --locked \
&& mkdir -p /out/data && cp target/release/pl8inf /out/pl8inf
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /out/pl8inf /pl8inf
COPY --from=build --chown=10001:10001 /out/data /data
ENV HOST=0.0.0.0 \
PORT=8790 \
PL8_DB=/data/pl8list.db \
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
USER 10001:10001
VOLUME /data
EXPOSE 8790
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s CMD ["/pl8inf", "--healthcheck"]
ENTRYPOINT ["/pl8inf"]