|
|
|
FROM python:3.11-slim |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
libreoffice \ |
|
libreoffice-writer \ |
|
libreoffice-calc \ |
|
libreoffice-impress \ |
|
fonts-liberation \ |
|
fonts-dejavu-core \ |
|
curl \ |
|
&& rm -rf /var/lib/apt/lists/* \ |
|
&& apt-get clean |
|
|
|
|
|
RUN useradd -m -u 1000 user && \ |
|
mkdir -p /app/uploads /app/web && \ |
|
chown -R user:user /app |
|
|
|
|
|
USER user |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH \ |
|
PYTHONPATH=/app \ |
|
PYTHONUNBUFFERED=1 |
|
|
|
|
|
COPY --chown=user:user requirements.txt . |
|
RUN pip install --no-cache-dir --upgrade pip && \ |
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY --chown=user:user . . |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python", "app/main.py"] |