mirror of
https://github.com/oasis6212/Meshbot_weather.git
synced 2025-12-10 00:06:12 -06:00
- 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.
34 lines
789 B
Docker
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"]
|