Skip to content

Commit 494898f

Browse files
committed
ah well
1 parent 82e6ad6 commit 494898f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
1-
FROM pytorch/pytorch:latest
1+
FROM python:3.11-slim AS dependencies
22

33
WORKDIR /app
44

55
ARG TARGETARCH
66

7+
# apt-update and install dependencies, with cache
8+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
9+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
10+
apt update && apt-get --no-install-recommends install -y python3-opencv gcc
11+
12+
FROM dependencies
13+
14+
WORKDIR /app
15+
716
COPY pyproject.toml ./
817
COPY src/ ./src/
18+
919
COPY models/best_float32.tflite ./models/
1020

1121
# pip install dependencies for the detected architecture, with cache
1222
RUN --mount=type=cache,target=/root/.cache \
1323
if [ "$TARGETARCH" = "arm64" ]; then \
1424
apt install -y libcamera; \
15-
pip install .[pi] --break-system-packages; \
25+
pip install .[pi]; \
1626
else \
17-
pip install . --break-system-packages; \
27+
pip install .; \
1828
fi
1929

2030
EXPOSE 8080

0 commit comments

Comments
 (0)