From ca62675866826ae1ef3a9902544533408a558864 Mon Sep 17 00:00:00 2001 From: ra_ma Date: Sat, 20 Sep 2025 13:15:15 +0100 Subject: [PATCH] first build --- Dockerfile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 816c1ee..e98e3f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,27 @@ -# Stage 1: Build React/Next.js frontend +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 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/ -# Stage 2: Build Go backend FROM golang:1.23-alpine AS backend-build WORKDIR /app -COPY . . +COPY --from=downloader /src/seanime* ./ COPY --from=frontend-build /app/web ./web RUN go build -o seanime -trimpath -ldflags="-s -w" -# Stage 3: Production container FROM alpine:latest WORKDIR /app COPY --from=backend-build /app/seanime .