-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.raspberry
More file actions
40 lines (32 loc) · 911 Bytes
/
Copy pathDockerfile.raspberry
File metadata and controls
40 lines (32 loc) · 911 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
35
36
37
38
39
40
# Dockerfile for Raspberry Pi (ARM64)
# Optimized for constrained devices with PiCamera support
FROM python:3.11-slim-bookworm
# Install system dependencies for camera, OpenCV, and audio
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
portaudio19-dev \
ffmpeg \
# PiCamera2 dependencies
libcamera-dev \
libcamera-apps-lite \
python3-libcamera \
python3-kms++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create non-root user
RUN useradd --create-home appuser && chown -R appuser:appuser /app
USER appuser
# Environment
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Entry point
CMD ["python", "main.py"]