This repository was archived by the owner on May 22, 2026. It is now read-only.
forked from danimaribeiro/PyTrustNFe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (43 loc) · 1.53 KB
/
Dockerfile
File metadata and controls
52 lines (43 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Python 3.8 / Debian bookworm — lxml+xmlsec são recompiladas contra libs do sistema (mais estável que wheel misto na PyPI).
FROM python:3.8-slim-bookworm
ENV POETRY_VERSION=1.8.5 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=false \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Runtime + headers so lxml+xmlsec rebuild against the same system libxml2/libxmlsec1 (manylinux wheels can still mismatch).
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl \
libxml2 libxslt1.1 libxmlsec1 libxmlsec1-openssl openssl \
libxml2-dev libxslt1-dev libxmlsec1-dev \
zlib1g-dev pkg-config build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY pyproject.toml poetry.lock poetry.toml README.md /workspace/
COPY pytrustnfe /workspace/pytrustnfe
COPY tests /workspace/tests
RUN pip install "poetry==${POETRY_VERSION}" \
&& poetry install --with dev \
&& poetry run python - <<'PY'
import subprocess
import sys
from pkg_resources import get_distribution
lv = get_distribution("lxml").version
xv = get_distribution("xmlsec").version
subprocess.check_call(
[
sys.executable,
"-m",
"pip",
"install",
"--no-cache-dir",
"--force-reinstall",
"--no-binary=lxml",
"--no-binary=xmlsec",
f"lxml=={lv}",
f"xmlsec=={xv}",
]
)
PY
RUN poetry run python -c "import lxml, xmlsec; print('xml stack ok', lxml.__version__)" \
&& poetry run pytest -q --tb=no
CMD ["poetry", "run", "pytest", "-q"]