-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (51 loc) · 1.6 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (51 loc) · 1.6 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
53
54
55
56
57
58
59
60
61
62
63
FROM python:3.12-slim-bookworm
ARG APP_UID=10001
ARG APP_GID=10001
LABEL org.opencontainers.image.title="Edge Traffic Vision"
LABEL org.opencontainers.image.description="CPU-only ONNX traffic video inference runtime"
LABEL org.opencontainers.image.source="https://github.com/NafizNoyon/edge-traffic-vision"
LABEL org.opencontainers.image.version="0.1.0"
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
YOLO_CONFIG_DIR=/tmp/ultralytics \
MPLCONFIGDIR=/tmp/matplotlib
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ffmpeg \
libgl1 \
libglib2.0-0 \
libgomp1 \
libsm6 \
libxext6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd --gid "${APP_GID}" appuser \
&& useradd \
--uid "${APP_UID}" \
--gid "${APP_GID}" \
--create-home \
--shell /usr/sbin/nologin \
appuser
WORKDIR /app
COPY requirements.txt pyproject.toml README.md ./
RUN python -m pip install --upgrade pip setuptools wheel \
&& python -m pip install --no-cache-dir -r requirements.txt
COPY src ./src
COPY configs ./configs
RUN python -m pip install --no-cache-dir --no-deps . \
&& mkdir -p \
/app/input \
/app/models/onnx \
/app/reports/video_inference \
/app/reports/metrics/video_inference \
/tmp/ultralytics \
/tmp/matplotlib \
&& chown -R appuser:appuser \
/app \
/tmp/ultralytics \
/tmp/matplotlib
USER appuser
ENTRYPOINT ["edge-traffic-video"]
CMD ["--help"]