chore: baseline plantilla-proyectos como base del CRM
This commit is contained in:
62
backend/Dockerfile
Normal file
62
backend/Dockerfile
Normal file
@@ -0,0 +1,62 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Instalar dependencias del sistema
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
postgresql-client \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Instalar dependencias para wkhtmltopdf y reportes PDF
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
xvfb \
|
||||
fontconfig \
|
||||
fonts-dejavu-core \
|
||||
libfontconfig1 \
|
||||
libxrender1 \
|
||||
libxtst6 \
|
||||
libxi6 \
|
||||
libxrandr2 \
|
||||
ca-certificates \
|
||||
libjpeg62-turbo \
|
||||
libpng16-16 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Instalar wkhtmltopdf binario oficial con soporte para footers/headers
|
||||
# TARGETARCH permite amd64 y arm64 (Apple Silicon)
|
||||
ARG TARGETARCH
|
||||
RUN curl -k -L -o /tmp/wkhtmltox.deb "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_${TARGETARCH}.deb" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y /tmp/wkhtmltox.deb \
|
||||
&& rm /tmp/wkhtmltox.deb \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& wkhtmltopdf --version
|
||||
|
||||
|
||||
# Copiar requirements
|
||||
COPY requirements.txt .
|
||||
|
||||
# Instalar dependencias Python
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Entrypoint (espera Postgres/Keycloak; no montar desde el host)
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Copiar código
|
||||
COPY . .
|
||||
|
||||
# Jenkins / CI pasan --build-arg APP_VERSION=…; debe quedar en ENV para runtime (API /version, OpenAPI, etc.)
|
||||
ARG APP_VERSION=dev-local
|
||||
ENV APP_VERSION=${APP_VERSION}
|
||||
|
||||
# Exponer puerto
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
# Comando por defecto
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
Reference in New Issue
Block a user