Meshbot_weather/Dockerfile
David Fries 43e50a79f1 Add Dockerfile and implement custom location lookup in meshbot.py
- Created a Dockerfile
- Added a new function `get_custom_lookup` in meshbot.py to handle custom location queries for weather information.
- Updated message handling to include custom location lookup in the response options.
- Modified weather_alert_monitor.py to support dynamic alert channel indexing.
- Updated settings.yaml to include configuration options for custom lookup, node shutdown, and alert channel index.
2025-08-03 18:07:21 -06:00

34 lines
789 B
Docker

# Efficient Dockerfile for Meshbot Weather
FROM python:3.13-slim
# Set environment variables for Python
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Create and set working directory
WORKDIR /app
# Install system dependencies (for serial, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libffi-dev \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy only requirements first for better caching
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the code
COPY meshbot.py ./
COPY settings.yaml ./
COPY modules/ ./modules/
COPY img/ ./img/
# Create a non-root user for security
RUN useradd -m meshbotuser
USER meshbotuser
# Entrypoint
ENTRYPOINT ["python", "meshbot.py"]