Files
mc-webui/Dockerfile
T
MarekWo 4c6857a00f feat: numbered releases (2.1.0) with git tags and GitHub releases
The app already knew exactly which build was running - a calendar version
of commit date plus short hash - but nothing gave a release a name users
could quote, and the repo had no tags at all.

Adds a VERSION file as the single source of truth for a SemVer release
number, read by app/version.py alongside the existing build string rather
than replacing it: the number is for people, the build is for pinning down
a deploy, and both ship in /api/version and the template context. The menu
shows the release first with the build underneath. #versionText still holds
the build string, because the remote-update poller compares it to detect
that the server came back on a new build.

Resolution order is unchanged (frozen file > git > fallback), and a frozen
file written before this change still yields a correct release number, so
an already-deployed server does not need re-freezing to stay sane. The
container has no git, hence COPY VERSION into the image - otherwise a plain
'docker compose build' reports 0.0.0.

scripts/release.sh cuts a release from main: it refuses a dirty tree, a
wrong branch, a malformed number or an existing tag, extracts the notes
from the matching whatsnew section, then tags, pushes and publishes via gh.

Numbering starts at 2.1.0 rather than 1.x: the v2 line has been in
production since March and 'v1' is the archived pre-migration branch, so
1.x would have been ambiguous. Sections in whatsnew before 2.1.0 keep
their date-only headings - they were never tagged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 19:20:57 +02:00

54 lines
1.6 KiB
Docker

# mc-webui v2 Dockerfile
# Single container with direct MeshCore device access (serial/TCP)
FROM python:3.11-slim
# Install runtime + build deps, pip install, then remove build-only packages
# Build deps (gcc, *-dev) needed for Pillow/pycryptodome wheels on ARM
RUN apt-get update && apt-get install -y \
curl \
udev \
bluez \
dbus \
gcc \
python3-dev \
libjpeg-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first for better layer caching
COPY requirements.txt .
# Install Python dependencies, then remove build-only packages
RUN pip install --no-cache-dir -r requirements.txt \
&& apt-get purge -y gcc python3-dev libjpeg-dev zlib1g-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Copy application code
# Note: Run 'python -m app.version freeze' before build to include version info.
# VERSION holds the release number and is read at /app/VERSION when no frozen
# version file is present (e.g. a plain 'docker compose build' during dev).
COPY VERSION ./
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
# Entrypoint: disconnect stale BLE connections before starting the app.
# BlueZ auto-reconnects trusted devices, leaving stale GATT notification
# handles that block bleak from establishing a new session.
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["python", "-m", "app.main"]