1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-04-17 13:28:27 +00:00
This commit is contained in:
Dametto Luca 2025-10-03 17:56:39 +05:30 committed by GitHub
commit e4618dd98f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 103 additions and 22 deletions

View file

@ -1,24 +1,31 @@
FROM python:3.12.3-alpine as base
WORKDIR /opt/hyperglass
ENV HYPERGLASS_APP_PATH=/etc/hyperglass
ENV HYPERGLASS_HOST=0.0.0.0
ENV HYPERGLASS_PORT=8001
ENV HYPERGLASS_DEBUG=false
ENV HYPERGLASS_DEV_MODE=false
ENV HYPERGLASS_REDIS_HOST=redis
ENV HYPEGLASS_DISABLE_UI=true
ENV HYPERGLASS_CONTAINER=true
COPY . .
FROM base as ui
WORKDIR /opt/hyperglass/hyperglass/ui
FROM python:3.12.3-alpine AS tools
RUN apk add build-base pkgconfig cairo-dev nodejs npm
RUN npm install -g pnpm
FROM tools AS base
ENV HYPERGLASS_APP_PATH=/etc/hyperglass \
HYPERGLASS_HOST=0.0.0.0 \
HYPERGLASS_PORT=8001 \
HYPERGLASS_DEBUG=false \
HYPERGLASS_DEV_MODE=false \
HYPERGLASS_REDIS_HOST=redis \
HYPEGLASS_DISABLE_UI=true \
HYPERGLASS_CONTAINER=true
FROM base AS deps
# JS Dependencies for UI
WORKDIR /opt/hyperglass/hyperglass/ui
COPY hyperglass/ui/package.json .
COPY hyperglass/ui/pnpm-lock.yaml .
RUN pnpm install -P
FROM ui as hyperglass
# Python Dependencies for Backend
WORKDIR /opt/hyperglass
RUN pip3 install -e .
COPY README.md .
COPY pyproject.toml .
RUN pip install -e .
FROM deps AS hyperglass
COPY . .
EXPOSE ${HYPERGLASS_PORT}
CMD ["python3", "-m", "hyperglass.console", "start"]

22
compose-self.yaml Normal file
View file

@ -0,0 +1,22 @@
services:
kv-storage:
image: "valkey/valkey:8-alpine"
hyperglass:
build: .
depends_on:
- kv-storage
environment:
- HYPERGLASS_APP_PATH=/etc/hyperglass
- HYPERGLASS_REDIS_HOST=${HYPERGLASS_REDIS_HOST-kv-storage}
- HYPERGLASS_HOST=${HYPERGLASS_HOST-0.0.0.0}
- HYPERGLASS_PORT=${HYPERGLASS_PORT-8001}
- HYPERGLASS_DEBUG=${HYPERGLASS_DEBUG-false}
- HYPERGLASS_DEV_MODE=${HYPERGLASS_DEV_MODE-false}
- HYPEGLASS_DISABLE_UI=${HYPEGLASS_DISABLE_UI-false}
- HYPERGLASS_CONTAINER=${HYPERGLASS_CONTAINER-true}
- HYPERGLASS_ORIGINAL_APP_PATH=${HYPERGLASS_APP_PATH}
ports:
- "${HYPERGLASS_PORT-8001}:${HYPERGLASS_PORT-8001}"
volumes:
- ${HYPERGLASS_APP_PATH-/etc/hyperglass}:/etc/hyperglass

View file

@ -1,21 +1,23 @@
services:
redis:
image: "redis:alpine"
kv-storage:
image: "valkey/valkey:8-alpine"
hyperglass:
image: ghcr.io/thatmattlove/hyperglass:main
restart: unless-stopped
depends_on:
- redis
- kv-storage
environment:
- HYPERGLASS_APP_PATH=/etc/hyperglass
- HYPERGLASS_REDIS_HOST=${HYPERGLASS_REDIS_HOST-kv-storage}
- HYPERGLASS_HOST=${HYPERGLASS_HOST-0.0.0.0}
- HYPERGLASS_PORT=${HYPERGLASS_PORT-8001}
- HYPERGLASS_DEBUG=${HYPERGLASS_DEBUG-false}
- HYPERGLASS_DEV_MODE=${HYPERGLASS_DEV_MODE-false}
- HYPERGLASS_REDIS_HOST=${HYPERGLASS_REDIS_HOST-redis}
- HYPEGLASS_DISABLE_UI=${HYPEGLASS_DISABLE_UI-false}
- HYPERGLASS_CONTAINER=${HYPERGLASS_CONTAINER-true}
- HYPERGLASS_ORIGINAL_APP_PATH=${HYPERGLASS_APP_PATH}
build: .
ports:
- "${HYPERGLASS_PORT-8001}:${HYPERGLASS_PORT-8001}"
volumes:
- ${HYPERGLASS_APP_PATH-/etc/hyperglass}:/etc/hyperglass
- ./data:/etc/hyperglass

View file

@ -2,6 +2,7 @@ import { Cards } from "nextra/components";
<Cards>
<Cards.Card href="installation/docker" title="Using Docker" />
<Cards.Card href="installation/docker-ghcr" title="Using Docker (GHCR)" />
<Cards.Card href="installation/manual" title="Manual Installation" />
</Cards>

View file

@ -0,0 +1,49 @@
---
title: Using Docker
description: Installing hyperglass with Docker
---
import { Cards, Steps, Callout } from "nextra/components";
// import { Callout } from "nextra-theme-docs";
<Callout type="info">**Docker is the recommended method for running hyperglass.**</Callout>
<Steps>
### Install Docker
<Cards>
<Cards.Card
title="Docker Engine Installation Guide"
href="https://docs.docker.com/engine/install/"
target="_blank"
arrow
/>
</Cards>
### Download hyperglass
```shell copy
mkdir /home/hyperglass
cd /home/hyperglass
wget "https://github.com/thatmattlove/hyperglass/blob/main/compose.yaml"
```
### Optional: Quickstart
Do this if you just want to see the hyperglass page working with a fake device.
```shell copy
mkdir data
wget -O ./data/devices.yaml "https://raw.githubusercontent.com/thatmattlove/hyperglass/refs/heads/main/.samples/sample_devices.yaml"
docker compose up
```
Navigate to http://IPADDRESS:8001
### Enable auto-restart
You may want to ensure that Hyperglass stays running even after a reboot.
To do this, you can easily change the "restart" parameter in `compose.yaml` to `always`.
</Steps>