From f037eb27f958937c5454487b9f33d628b7999496 Mon Sep 17 00:00:00 2001 From: George <3309978+gsilvr@users.noreply.github.com> Date: Sun, 1 Jun 2025 12:38:49 -0700 Subject: [PATCH] Added a working dockerfile and readme --- docker/Dockerfile | 28 ++++++++++++++++++++++++++++ docker/README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/README.md diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..3fff869 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,28 @@ +FROM python:3.12-slim + +# Set work directory +WORKDIR /app + +# Install system dependencies (graphviz required, git for cloning) +RUN apt-get update && \ + apt-get install -y --no-install-recommends git graphviz && \ + rm -rf /var/lib/apt/lists/* + +# Clone the repo with submodules +RUN git clone --recurse-submodules https://github.com/pablorevilla-meshtastic/meshview.git /app + +# Create virtual environment +RUN python -m venv /app/env + +# Upgrade pip and install requirements in venv +RUN /app/env/bin/pip install --no-cache-dir --upgrade pip && \ + /app/env/bin/pip install --no-cache-dir -r /app/requirements.txt + +# Copy sample config +RUN cp /app/sample.config.ini /app/config.ini + +# Expose port +EXPOSE 8081 + +# Run the app via venv +CMD ["/app/env/bin/python", "/app/mvrun.py"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..d5531a5 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,44 @@ +# MeshView Docker Container + +This Dockerfile builds a containerized version of the [MeshView](https://github.com/pablorevilla-meshtastic/meshview) application. It uses a lightweight Python environment and sets up the required virtual environment as expected by the application. + +## Image Details + +- **Base Image**: `python:3.12-slim` +- **Working Directory**: `/app` +- **Python Virtual Environment**: `/app/env` +- **Exposed Port**: `8081` + +## Build Instructions + +Build the Docker image: + +```bash +docker build -t meshview-docker . +``` + +## Run Instructions + +Run the container: + +```bash +docker run -d --name meshview-docker -p 8081:8081 meshview-docker +``` + +This maps container port `8081` to your host. The application runs via: + +```bash +/app/env/bin/python /app/mvrun.py +``` + +## Web Interface + +Once the container is running, you can access the MeshView web interface by visiting: + +http://localhost:8081 + +If running on a remote server, replace `localhost` with the host's IP or domain name: + +http://:8081 + +Ensure that port `8081` is open and not blocked by a firewall or security group.