1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

add docker & docker compose support

This commit is contained in:
thatmattlove
2024-03-03 00:21:43 -05:00
parent 016cfd71d4
commit 09a451c55f
4 changed files with 93 additions and 0 deletions

43
.dockerignore Normal file
View File

@@ -0,0 +1,43 @@
hyperglass/hyperglass/static
node_modules
.DS_Store
hyperglass/ui/.env*
hyperglass.json
custom.*[js, html]
.next
out/
fonts/
__pycache__
.python-version
.venv
.mypy_cache
.pytest_cache
.ruff_cache
*.so
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
*.rdb
*.py[cod]
.ipynb*

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
# Project
hyperglass/hyperglass/static
TODO*
.env
test.py
.DS_Store

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
FROM python:3.12.2-bookworm 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
# RUN curl -sSf https://rye-up.com/get | RYE_INSTALL_OPTION="--yes" bash
# ENV PATH="${PATH}:$HOME/.rye/shims"
COPY . .
# RUN $HOME/.rye/shims/rye sync
# RUN . ./.venv/bin/activate
RUN pip3 install .
FROM base as ui
WORKDIR /opt/hyperglass/hyperglass/ui
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g pnpm
RUN pnpm install -P
FROM ui as hyperglass
WORKDIR /opt/hyperglass
EXPOSE ${HYPERGLASS_PORT}
CMD ["python3", "-m", "hyperglass.console", "start"]

19
compose.yaml Normal file
View File

@@ -0,0 +1,19 @@
services:
redis:
image: "redis:alpine"
hyperglass:
depends_on:
- redis
environment:
- HYPERGLASS_APP_PATH=/etc/hyperglass
- 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}
build: .
ports:
- "${HYPERGLASS_PORT-8001}:${HYPERGLASS_PORT-8001}"
volumes:
- ${HYPERGLASS_APP_PATH-/etc/hyperglass}:/etc/hyperglass