26 lines
631 B
Docker
26 lines
631 B
Docker
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
SVRNTY_VISION_HOST=0.0.0.0 \
|
|
SVRNTY_VISION_PORT=8094
|
|
|
|
WORKDIR /app
|
|
|
|
RUN useradd --create-home --shell /usr/sbin/nologin vision
|
|
|
|
COPY pyproject.toml README.md ./
|
|
COPY src ./src
|
|
|
|
RUN python -m pip install --no-cache-dir --upgrade pip \
|
|
&& python -m pip install --no-cache-dir .
|
|
|
|
USER vision
|
|
|
|
EXPOSE 8094
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8094/healthz', timeout=3).read()"
|
|
|
|
CMD ["python", "-m", "svrnty_vision.server"]
|