mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-05-02 03:22:40 +02:00
Integrate meshcore library's BLE connection (via bleak) as a third transport option alongside serial and TCP. Priority: BLE > TCP > Serial. Config: MC_BLE_ADDRESS and MC_BLE_PIN environment variables. Docker: bluez/dbus packages, NET_ADMIN cap, D-Bus socket mount. UI: transport type badge in navbar, transport_type in /api/status. Watchdog: skip USB reset for BLE connections (same as TCP). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
849 B
Docker
37 lines
849 B
Docker
# mc-webui v2 Dockerfile
|
|
# Single container with direct MeshCore device access (serial/TCP)
|
|
|
|
FROM python:3.11-slim
|
|
|
|
# Install system deps: curl (healthcheck), udev (serial), bluez+dbus (BLE)
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
udev \
|
|
bluez \
|
|
dbus \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy requirements first for better layer caching
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
# Note: Run 'python -m app.version freeze' before build to include version info
|
|
COPY app/ ./app/
|
|
|
|
# Expose Flask port
|
|
EXPOSE 5000
|
|
|
|
# Environment variables (can be overridden by docker-compose)
|
|
ENV FLASK_HOST=0.0.0.0
|
|
ENV FLASK_PORT=5000
|
|
ENV FLASK_DEBUG=false
|
|
|
|
# Run the application
|
|
CMD ["python", "-m", "app.main"]
|