summaryrefslogtreecommitdiff
path: root/f3s
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-31 17:21:02 +0200
committerPaul Buetow <paul@buetow.org>2026-01-31 17:21:02 +0200
commitb3b781a8b5f75a83183108ac9fa98c71b12bb714 (patch)
tree21c16b40f37aa8e9a5949df2ab0d21ddd0584735 /f3s
parentebbd334691d5a1c884eb6d4965fc00d188a3c790 (diff)
Add MinVid Docker image build files
Amp-Thread-ID: https://ampcode.com/threads/T-019c1492-bec0-70f8-8d02-ef3596a7228b Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'f3s')
-rw-r--r--f3s/minvid/docker-image/Dockerfile46
-rw-r--r--f3s/minvid/docker-image/Justfile7
-rw-r--r--f3s/minvid/docker-image/entrypoint.sh14
-rw-r--r--f3s/minvid/helm-chart/templates/deployment.yaml2
4 files changed, 68 insertions, 1 deletions
diff --git a/f3s/minvid/docker-image/Dockerfile b/f3s/minvid/docker-image/Dockerfile
new file mode 100644
index 0000000..2967aaa
--- /dev/null
+++ b/f3s/minvid/docker-image/Dockerfile
@@ -0,0 +1,46 @@
+# Build frontend
+FROM node:20-alpine AS frontend-builder
+WORKDIR /build
+RUN apk add --no-cache git
+RUN git clone https://github.com/Ludvigaman/MinVid.git .
+WORKDIR /build/MinVid
+RUN npm install && npm run build
+
+# Build API
+FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS api-builder
+WORKDIR /build
+RUN apk add --no-cache git
+RUN git clone https://github.com/Ludvigaman/MinVid.git .
+WORKDIR /build/MinVid-API
+RUN dotnet publish -c Release -o /app/publish
+
+# Final image
+FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
+
+ENV PUID=1000
+ENV PGID=1000
+
+RUN apk add --no-cache bash su-exec ffmpeg
+
+WORKDIR /app
+
+# Copy API
+COPY --from=api-builder /app/publish .
+
+# Copy frontend dist
+COPY --from=frontend-builder /build/MinVid/dist ./wwwroot
+
+EXPOSE 80
+
+COPY entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+
+ENTRYPOINT ["/entrypoint.sh"]
+CMD ["dotnet", "MinVid.dll"]
+
+HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
+ CMD wget -qO- http://127.0.0.1:80/health || exit 0
+
+VOLUME /app/data
+
+LABEL maintainer="MinVid Contributors"
diff --git a/f3s/minvid/docker-image/Justfile b/f3s/minvid/docker-image/Justfile
new file mode 100644
index 0000000..12fa1cb
--- /dev/null
+++ b/f3s/minvid/docker-image/Justfile
@@ -0,0 +1,7 @@
+all:
+ docker build -t minvid:latest .
+
+f3s:
+ docker build -t minvid:latest .
+ docker tag minvid:latest r0.lan.buetow.org:30001/minvid:latest
+ docker push r0.lan.buetow.org:30001/minvid:latest
diff --git a/f3s/minvid/docker-image/entrypoint.sh b/f3s/minvid/docker-image/entrypoint.sh
new file mode 100644
index 0000000..7865234
--- /dev/null
+++ b/f3s/minvid/docker-image/entrypoint.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Create user and group if they don't exist
+if ! id -u minvid &>/dev/null; then
+ addgroup -g ${PGID} minvid
+ adduser -D -u ${PUID} -G minvid minvid
+fi
+
+# Ensure data directory exists and has correct permissions
+mkdir -p /app/data
+chown -R minvid:minvid /app/data
+
+# Execute the main command as minvid user
+exec su-exec minvid "$@"
diff --git a/f3s/minvid/helm-chart/templates/deployment.yaml b/f3s/minvid/helm-chart/templates/deployment.yaml
index eb1f2d8..fdc6fe3 100644
--- a/f3s/minvid/helm-chart/templates/deployment.yaml
+++ b/f3s/minvid/helm-chart/templates/deployment.yaml
@@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: minvid
- image: registry.f3s.buetow.org/minvid:latest
+ image: r0.lan.buetow.org:30001/minvid:latest
imagePullPolicy: Always
ports:
- containerPort: 80