ARG VERSION=latest # Prep Files FROM alpine:latest as downloader WORKDIR /src # Install dependencies RUN apk add --no-cache curl tar wget # Fetch the latest tag and download the source code RUN curl -s https://api.github.com/repos/5rahim/seanime/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' > tag.file && \ TAG=$(cat tag.file) && \ wget https://github.com/5rahim/seanime/archive/refs/tags/${TAG}.tar.gz && \ tar -xzvf ${TAG}.tar.gz && \ rm ${TAG}.tar.gz tag.file && \ mv seanime-* seanime # Start web build FROM node:18-alpine AS frontend-build # Set working directory to the extracted source code WORKDIR /app/seanime-web # Copy source from downloader COPY --from=downloader /src/seanime/seanime-web ./ # Build the web interface RUN npm install && \ npm run build && \ mkdir -p /app/web && \ cp -r out/* /app/web/ # Start backend build FROM golang:1.24-alpine AS backend-build # set build root WORKDIR /build # Copy needed files from previous stages COPY --from=downloader /src/seanime /build COPY --from=frontend-build /app/web /build/web # Build the server for Linux RUN go build -o seanime -trimpath -ldflags="-s -w" # Complete the APP FROM alpine:latest # Set root WORKDIR /app # Copy preped builds COPY --from=backend-build /build/seanime . # Set up the data directory VOLUME /DATA # Expose the port EXPOSE 43211 # Command to run the server CMD ["/app/seanime", "--datadir", "/DATA"]