Added docker/compose stuff and hopefully fixed CI
Some checks failed
CI / check (push) Failing after 12s
Some checks failed
CI / check (push) Failing after 12s
This commit is contained in:
44
Dockerfile
Normal file
44
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user