summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--_ci/Containerfile.h2g44
2 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index cd4c246..05ba371 100644
--- a/Makefile
+++ b/Makefile
@@ -38,3 +38,6 @@ gemini: clean
mv _layouts _layouts.gemini
mv _layouts.bak _layouts
rm -rf _site/category
+ test -e _html2gemini || git clone -b main https://git.uvok.de/html2gemini _html2gemini
+
+#podman run --rm -it -v ./_site:/site:Z -v ./_gemini:/app/output/gemini:Z <image>
diff --git a/_ci/Containerfile.h2g b/_ci/Containerfile.h2g
new file mode 100644
index 0000000..98f62b0
--- /dev/null
+++ b/_ci/Containerfile.h2g
@@ -0,0 +1,44 @@
+# HTML 2 Gemini converter
+FROM alpine:3.24 AS builder
+
+# Install build dependencies
+RUN apk add --no-cache \
+ python3 \
+ py3-pip \
+ gcc \
+ musl-dev \
+ python3-dev
+
+WORKDIR /build
+
+# Create virtual environment
+RUN python3 -m venv /build/venv
+
+COPY _html2gemini/requirements.txt .
+
+RUN . /build/venv/bin/activate && \
+ pip install --no-cache-dir -r requirements.txt
+
+# Final runtime stage
+FROM alpine:3.24
+
+LABEL maintainer="Uvokchee" \
+ description="HTML to Gemini converter" \
+ version="1.0"
+
+# Install runtime dependencies
+RUN apk add --no-cache python3
+
+WORKDIR /app
+
+# Copy virtual environment from builder
+COPY --from=builder /build/venv /app/venv
+
+# Copy application files
+COPY _html2gemini/main.py .
+COPY _html2gemini/converters ./converters
+
+# Set environment variables
+ENV PATH=/app/venv/bin:$PATH \
+ PYTHONUNBUFFERED=1 \
+ PYTHONDONTWRITEBYTECODE=1