blob: 5395658bbfe62542e94ba1fe1481f5a8a84b9c4a (
plain)
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
|
# Base image
FROM python:3.10-slim
# Set the working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN apt update && apt install curl -y && apt upgrade -y
# Copy the rest of the application files
COPY ./scripts/monitor.py ./monitor.py
COPY ./scripts/config.json ./config.json
COPY ./model/garage_door_classifier.h5 ./model/garage_door_classifier.h5
# Test the Python script to verify it runs correctly
RUN python monitor.py --test
# Suppress TensorFlow warnings (optional)
ENV TF_CPP_MIN_LOG_LEVEL=2
# Add a health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD curl -f http://127.0.0.1:8080 || exit 1
# Run the monitoring script
CMD ["python", "monitor.py"]
|