-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (36 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
52 lines (36 loc) · 1.23 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
FROM bluenviron/mediamtx:1 AS mediamtx
FROM python:3.12-slim
# Set working directory inside the container
WORKDIR /app
# Copy MediaMTX binary from official image
COPY --from=mediamtx /mediamtx /usr/local/bin/mediamtx
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Copy app directory contents
COPY app/ /app/
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /app/requirements.txt
# Make scripts executable
RUN chmod +x /app/startup.sh /app/healthcheck.py
# Create data directory for persistent config and credentials
RUN mkdir -p /data
# Add healthcheck
# Runs every 30 seconds, starts checking after 60 seconds,
# allows 10 seconds for the check to complete,
# marks unhealthy after 3 consecutive failures
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python3 /app/healthcheck.py || exit 1
# Environment variables (can be overridden at runtime)
ENV WEB_PORT=8080 \
WEB_HOST=0.0.0.0 \
MYBLINK_CONFIG=/data/config.yaml
# Expose web interface port
EXPOSE 8080
# Use SIGTERM for graceful shutdown
STOPSIGNAL SIGTERM
# Set entry point
CMD ["./startup.sh"]