-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (41 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
55 lines (41 loc) · 1.3 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
# syntax=docker/dockerfile:1
FROM dtcooper/raspberrypi-os:bookworm
LABEL maintainer="signag"
RUN apt update && apt -y upgrade
RUN apt update && apt install -y \
gcc-aarch64-linux-gnu \
systemd \
systemd-timesyncd \
python3 \
python3-dev \
python3-pip \
python3-venv \
python3-opencv \
python3-gpiozero \
python3-lgpio \
ffmpeg \
python3-picamera2 --no-install-recommends \
imx500-all \
dpkg-dev \
v4l-utils
RUN ln -s /usr/bin/python3 /usr/bin/python
# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
# Copy the source code into the container.
COPY . .
# Install Python dependencies in virtual environment
RUN python -m venv --system-site-packages .venv
ENV PATH=".venv/bin:$PATH"
RUN pip install --no-cache-dir -r requirements.txt
# Expose the port that the application listens on.
EXPOSE 5000
# Initialize database for Flask
RUN flask --app raspiCamSrv init-db
# Run the application.
CMD gunicorn -b 0.0.0.0:5000 -w 1 -k gthread --threads 6 --timeout 0 --log-level info 'raspiCamSrv:create_app()'