Skip to content

Commit

Permalink
add docker & docker compose support
Browse files Browse the repository at this point in the history
  • Loading branch information
thatmattlove committed Mar 3, 2024
1 parent 016cfd7 commit 09a451c
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Project
hyperglass/hyperglass/static
TODO*
.env

test.py
.DS_Store
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 changes: 19 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 09a451c

Please sign in to comment.