30 lines
685 B
Docker
30 lines
685 B
Docker
|
|
FROM python:3.11-slim
|
||
|
|
|
||
|
|
LABEL maintainer="Watchdog Docker"
|
||
|
|
LABEL version="0.1"
|
||
|
|
LABEL description="OPNsense Monitoring Container"
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Install system dependencies
|
||
|
|
RUN apt-get update && apt-get install -y \
|
||
|
|
gcc \
|
||
|
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
|
||
|
|
# Copy requirements
|
||
|
|
COPY requirements.txt .
|
||
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
||
|
|
|
||
|
|
# Copy application
|
||
|
|
COPY app/ ./app/
|
||
|
|
COPY config/ ./config/
|
||
|
|
|
||
|
|
# Create data directory
|
||
|
|
RUN mkdir -p /app/data
|
||
|
|
|
||
|
|
EXPOSE 5000
|
||
|
|
|
||
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||
|
|
CMD python -c "import requests; requests.get('http://localhost:5000/health', timeout=5)" || exit 1
|
||
|
|
|
||
|
|
CMD ["python", "app/main.py"]
|