FROM python:3.13-slim

# Install system dependencies including zint and fonts
RUN apt-get update && apt-get install -y \
    libzint-dev \
    fonts-dejavu-core \
    fonts-ocr-a \
    && rm -rf /var/lib/apt/lists/*

# Install fonts to /usr/share/fonts for embedding
RUN mkdir -p /usr/share/fonts/custom && \
    cp /usr/share/fonts/dejavu/DejaVuSans*.ttf /usr/share/fonts/custom/ 2>/dev/null || true

# Set working directory
WORKDIR /app

# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY app.py .

# Expose port
EXPOSE 5000

# Run the application
CMD ["python", "app.py"]