7dcc7dc0e1
This adds nginx dual-path routing, forwarded proxy headers, Uvicorn proxy-headers, production security settings, and deployment docs for https://sinbad2.ujaen.es/generadorexamenesllm/.
34 lines
699 B
Docker
34 lines
699 B
Docker
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
tesseract-ocr \
|
|
tesseract-ocr-spa \
|
|
tesseract-ocr-eng \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN addgroup --system app && adduser --system --ingroup app app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app ./app
|
|
|
|
RUN mkdir -p /app/uploads && chown -R app:app /app/uploads
|
|
|
|
USER app
|
|
|
|
EXPOSE 8074
|
|
|
|
CMD ["uvicorn", "app.main:app", \
|
|
"--host", "0.0.0.0", \
|
|
"--port", "8074", \
|
|
"--proxy-headers", \
|
|
"--forwarded-allow-ips", "*", \
|
|
"--no-server-header"]
|