summaryrefslogtreecommitdiff
path: root/Containerfile
blob: 25ecd216fa27c633b679ee135488f3fa79e31202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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 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 main.py .
COPY converters ./converters

# Set environment variables
ENV PATH=/app/venv/bin:$PATH \
    PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1