Files
plantillas-proyectos/backend/Dockerfile
acazares 27d9625bd0 Implement automatic versioning and display in the application
- Added a step in the CI/CD pipeline to generate a version based on the branch and commit history.
- Updated Dockerfile to accept the application version as an argument.
- Modified the configuration to retrieve the application version from the environment variable.
- Created a new API endpoint to expose the application version.
- Added a new Svelte component to display the application version in the UI.
2026-02-05 09:58:35 -06:00

57 lines
1.4 KiB
Docker

FROM python:3.11-slim
WORKDIR /app
# ========================================
# ARG para recibir la versión desde CI/CD
# ========================================
ARG APP_VERSION="dev"
ENV APP_VERSION=${APP_VERSION}
# 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
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_amd64.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
# Copiar código
COPY . .
# Exponer puerto
EXPOSE 8000
# Comando por defecto
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]