feat: added build/test pipeline
CI / test (push) Failing after 6s
CI / build (push) Has been skipped

This commit is contained in:
2026-07-16 14:55:07 +02:00
parent 903d016330
commit ba7b8a9f97
12 changed files with 262 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
FROM python:3.13-alpine3.23 AS builder
ENV UV_SYSTEM_PYTHON=1
COPY pyproject.toml .
RUN pip install uv && uv pip install -r pyproject.toml && pip uninstall -y uv
FROM python:3.13-alpine3.23
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
WORKDIR /code
# Set user and group
ARG user=apps
ARG uid=1001
ARG gid=1001
RUN addgroup -S ${user} && adduser -S ${user} -G ${user} -u ${uid} -s /bin/sh
# pango + ttf-dejavu: librerías nativas que weasyprint necesita en tiempo de
# ejecución (no al instalar el paquete Python, que ya funciona sin esto) para
# poder generar el PDF del patrón (ver PatternPdfView); sin fuentes
# instaladas, Pango no tiene nada que medir/dibujar y WeasyPrint termina
# haciendo segfault en vez de fallar con un error legible.
RUN apk update && apk add gcc gettext vim libpq-dev pango ttf-dejavu
RUN chown -R ${user}:${user} /code
USER ${user}
COPY --chown=${user}:${user} . /code
RUN ["sh", "./scripts/build.sh"]
CMD ["sh", "./scripts/run.sh"]