-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile.qreader
More file actions
34 lines (22 loc) · 910 Bytes
/
Dockerfile.qreader
File metadata and controls
34 lines (22 loc) · 910 Bytes
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
FROM python:3.13-slim-bookworm
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
libzbar0 \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /app
ENV PORT=4445
COPY qreader/pyproject.toml ./pyproject.toml
RUN python -c "import tomllib; from pathlib import Path; data = tomllib.loads(Path('pyproject.toml').read_text()); deps = data.get('project', {}).get('dependencies', []); Path('requirements.txt').write_text('\n'.join(deps) + '\n')"
RUN uv pip install --system --no-cache -r requirements.txt
COPY qreader/main.py ./main.py
STOPSIGNAL SIGTERM
HEALTHCHECK --interval=10s --timeout=10s --start-period=30s --retries=3 \
CMD sh -c 'curl -fsS "http://127.0.0.1:${PORT:-4445}/health" || exit 1'
EXPOSE 4445
CMD ["python", "main.py"]