32 lines
1.0 KiB
Docker
32 lines
1.0 KiB
Docker
ARG VERSION=latest
|
|
FROM alpine:latest as downloader
|
|
WORKDIR /src
|
|
RUN apk add --no-cache curl tar
|
|
# Download latest release info and extract the version tag
|
|
RUN curl -s https://api.github.com/repos/5rahim/seanime/releases/${VERSION} \
|
|
| grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' > /src/tag.txt
|
|
RUN TAG=$(cat /src/tag.txt) && \
|
|
curl -L https://github.com/5rahim/seanime/archive/refs/tags/${TAG}.tar.gz -o seanime.tar.gz && \
|
|
tar -xzvf seanime.tar.gz
|
|
|
|
FROM node:18-alpine AS frontend-build
|
|
WORKDIR /app/seanime-web
|
|
COPY --from=downloader /src/seanime*/seanime-web ./
|
|
RUN npm install
|
|
RUN npm run build
|
|
RUN mkdir -p /app/web && cp -r out/* /app/web/
|
|
|
|
FROM golang:1.23-alpine AS backend-build
|
|
WORKDIR /app
|
|
COPY --from=downloader /src/seanime* ./
|
|
COPY --from=frontend-build /app/web ./web
|
|
RUN go build -o seanime -trimpath -ldflags="-s -w"
|
|
|
|
FROM alpine:latest
|
|
WORKDIR /app
|
|
COPY --from=backend-build /app/seanime .
|
|
COPY --from=backend-build /app/web ./web
|
|
EXPOSE 43211
|
|
VOLUME ["/DATA"]
|
|
CMD ["./seanime", "--datadir", "/DATA", "--port", "43211"]
|