feat: added build/test pipeline
This commit is contained in:
+31
@@ -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"]
|
||||
Reference in New Issue
Block a user