31 lines
602 B
Docker
31 lines
602 B
Docker
FROM python:3.12-slim
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
libffi-dev \
|
|
libxml2 \
|
|
libxslt1-dev \
|
|
libjpeg-dev \
|
|
zlib1g-dev \
|
|
libpoppler-cpp-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set workdir
|
|
WORKDIR /app
|
|
|
|
# Copy requirements first (better caching)
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Make invoices folder inside container
|
|
RUN mkdir -p /app/invoices
|
|
|
|
# Run script
|
|
CMD ["python", "main.py"]
|