Added docker/compose stuff and hopefully fixed CI
Some checks failed
CI / check (push) Failing after 12s

This commit is contained in:
Connor Johnstone
2026-03-19 12:12:50 -04:00
parent 82c82ae46a
commit f837156fcc
6 changed files with 108 additions and 0 deletions

44
Dockerfile Normal file
View File

@@ -0,0 +1,44 @@
# Stage 1: Build frontend (Yew/WASM)
FROM rust:1-bookworm AS frontend
RUN rustup target add wasm32-unknown-unknown \
&& cargo install trunk
WORKDIR /build
COPY . .
RUN rustup target list --installed && cd shanty-web/frontend && trunk build --release
# Stage 2: Build backend
FROM rust:1-bookworm AS backend
WORKDIR /build
COPY . .
COPY --from=frontend /build/shanty-web/static ./shanty-web/static
RUN cargo build --release --bin shanty
# Stage 3: Runtime
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates ffmpeg python3 python3-pip python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/venv \
&& /opt/venv/bin/pip install --no-cache-dir ytmusicapi yt-dlp
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /app
COPY --from=backend /build/target/release/shanty .
COPY --from=backend /build/shanty-web/static ./static
COPY --from=backend /build/shanty-dl/scripts/ytmusic_search.py /usr/share/shanty/
RUN mkdir -p /config /data /music
ENV SHANTY_CONFIG=/config/config.yaml
ENV SHANTY_DATABASE_URL=sqlite:///data/shanty.db?mode=rwc
ENV SHANTY_LIBRARY_PATH=/music
ENV SHANTY_DOWNLOAD_PATH=/data/downloads
EXPOSE 8085
VOLUME ["/config", "/data", "/music"]
CMD ["./shanty"]