-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (49 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
61 lines (49 loc) · 1.26 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
56
57
58
59
60
61
FROM python:3.11-slim
# Install system dependencies for OpenCV
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
libgomp1 \
ffmpeg \
wget \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Download go2rtc binary
RUN wget -q https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64 -O /app/go2rtc \
&& chmod +x /app/go2rtc
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Install the package
RUN pip install --no-cache-dir -e .
# Create videos directory for uploads
RUN mkdir -p /app/videos
# Copy and setup entrypoint
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Expose ports
# 8080 - ONVIF/Web UI
# 3702 - WS-Discovery (UDP)
# 1984 - go2rtc API
# 8554 - RTSP
# 1935 - RTMP
# 8555 - WebRTC
EXPOSE 8080
EXPOSE 3702/udp
EXPOSE 1984
EXPOSE 8554
EXPOSE 1935
EXPOSE 8555/udp
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Default command - start in video upload mode
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["--source", "video"]
CMD ["--source", "video"]