-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.worker
More file actions
23 lines (22 loc) · 1023 Bytes
/
Copy pathDockerfile.worker
File metadata and controls
23 lines (22 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# syntax=docker/dockerfile:1
# A Python worker image. Build context is the repository root.
#
# Installs the braidpipe worker SDK from python/ as a real package, then lays
# the example workers in /app; pick one with the compose service's `command:`
# (default: worker_edges.py). worker_detect.py would additionally need
# `pip install ultralytics` and the yolov8n.pt weights.
FROM python:3.12-slim
# On networks where pypi.org is unreachable, point this at a full mirror, e.g.
# PIP_INDEX_URL=https://mirror-pypi.runflare.com/simple docker compose up --build
ARG PIP_INDEX_URL=https://pypi.org/simple
# As an ENV, the mirror also covers the isolated build env pip creates while
# packaging the SDK below.
ENV PIP_INDEX_URL=$PIP_INDEX_URL
RUN pip install --no-cache-dir numpy opencv-python-headless
COPY python/ /opt/braidpipe-python/
RUN pip install --no-cache-dir --no-deps /opt/braidpipe-python \
&& rm -rf /opt/braidpipe-python
WORKDIR /app
COPY examples/ ./
ENTRYPOINT ["python3", "-u"]
CMD ["worker_edges.py"]