Spaces:
Sleeping
Sleeping
Commit ·
6590d03
1
Parent(s): 0c3044a
standardize dockerfiles
Browse filesFiles changed (6)
- .dockerignore+26-15
- Dockerfile+6
- README.md+2-4
- docker-compose.dev.yml+6-2
- docker-compose.yml+10-16
- justfile+5-9
12345678910111213142 unmodified lines171819202122232425262728.git.gitignore.venvvenvenv.env.ruff_cache.mypy_cache.pytest_cachehtmlcov.coverage__pycache__*.py[cod]*$py.class2 unmodified lines.eggsdistbuild.DS_Storedata/docs/tests/*.fitsDockerfiledocker-compose.yml.dockerignore.pre-commit-config.yaml12342 unmodified lines789101112131415161718192021222324252627282930313233343536373839# python__pycache__*.py[cod]*$py.class2 unmodified lines.eggsdistbuild.venvvenvenv# tooling.git.gitignore.ruff_cache.mypy_cache.pytest_cache.pre-commit-config.yamlhtmlcov.coverage.DS_Store.github/.claude/# project.env.env.*docker-compose*.ymljustfile# data & docsdata/docs/tests/*.fits*.md!README.md
15 unmodified lines16171819202113 unmodified lines353637383915 unmodified linesFROM python:3.13-slim AS runtimeENV PYTHONUNBUFFERED=1 \PYTHONDONTWRITEBYTECODE=1 \PATH="/app/.venv/bin:$PATH" \13 unmodified linesEXPOSE 5000ENTRYPOINT ["jellyscope"]CMD ["--host", "0.0.0.0", "--port", "5000", "--data-dir", "/data"]15 unmodified lines16171819202122232413 unmodified lines383940414243444515 unmodified linesFROM python:3.13-slim AS runtimeARG JELLYSCOPE_VERSION=devLABEL org.opencontainers.image.version="${JELLYSCOPE_VERSION}"ENV PYTHONUNBUFFERED=1 \PYTHONDONTWRITEBYTECODE=1 \PATH="/app/.venv/bin:$PATH" \13 unmodified linesEXPOSE 5000HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/').read()"ENTRYPOINT ["jellyscope"]CMD ["--host", "0.0.0.0", "--port", "5000", "--data-dir", "/data"]
49 unmodified lines5051525354555657585960616263646566676820 unmodified lines8990919293949549 unmodified lines```bashjust docker-build # docker compose buildjust docker-seed # copy ./data into the jellyscope-data volume (one-time)just docker-up # docker compose up -d```Then open <http://localhost:5000>.The data directory lives in a Docker-managed named volume (`jellyscope-data`) mounted read-only at `/data` inside the container. Override CLI flags ad-hoc:```bashdocker compose run --rm jellyscope --help```Tear down with `just docker-down` (add `-v` to the underlying `docker compose down` call to also remove the data volume).## Data Format20 unmodified linesjust spellcheck # Check for typos in code/docsjust serve # Start the dev serverjust docker-build # Build the Docker imagejust docker-seed # Copy ./data into the jellyscope-data volume (one-time)just docker-up # Start the containerized servicejust docker-down # Stop the containerized servicejust docker-logs # Tail container logs49 unmodified lines50515253545556575859606162636465666720 unmodified lines88899091929349 unmodified lines```bashjust docker-build # docker compose buildjust docker-up # docker compose up -d```Then open <http://localhost:5000>.The local `./data/` directory is bind-mounted read-only at `/data` inside the container. Override CLI flags ad-hoc:```bashdocker compose run --rm jellyscope --help```Tear down with `just docker-down`.## Data Format20 unmodified linesjust spellcheck # Check for typos in code/docsjust serve # Start the dev serverjust docker-build # Build the Docker imagejust docker-up # Start the containerized servicejust docker-down # Stop the containerized servicejust docker-logs # Tail container logs
123456789services:jellyscope:volumes:- ./src:/app/src:ro- ./data:/app/data:roworking_dir: /appentrypoint: ["uvicorn"]command:- "jellyscope.web:create_app"12345678910111213# Dev override layered on top of docker-compose.yml via `just docker-dev`.## Why the entrypoint is replaced: the `jellyscope` console script does not expose# a --reload flag, and uvicorn auto-reload requires invoking uvicorn directly with# --reload-dir. Source is bind-mounted read-only so edits trigger reload without rebuild.services:jellyscope:volumes:- ./src:/app/src:roentrypoint: ["uvicorn"]command:- "jellyscope.web:create_app"
12345678910111213141516171819202122232425262728services:jellyscope:build:context: .dockerfile: Dockerfileimage: jellyscope:latestcontainer_name: jellyscopeports:- "5000:5000"volumes:- jellyscope-data:/data:roenvironment:JELLYSCOPE_ENABLE_SED: "${JELLYSCOPE_ENABLE_SED:-false}"restart: unless-stoppedhealthcheck:test:- CMD- python- -c- "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/').read()"interval: 30stimeout: 5sretries: 3start_period: 20svolumes:jellyscope-data:name: jellyscope-data12345678910111213141516171819202122# Local-dev compose file. HF Space deploys via Dockerfile directly and does not use this file.# Image is version-tagged from pyproject.toml; pass JELLYSCOPE_VERSION via the just recipes.services:jellyscope:build:context: .dockerfile: Dockerfileargs:JELLYSCOPE_VERSION: "${JELLYSCOPE_VERSION:-dev}"image: jellyscope:${JELLYSCOPE_VERSION:-dev}container_name: jellyscopeports:- "5000:5000"volumes:- ./data:/data:roenv_file:- path: .envrequired: falseenvironment:JELLYSCOPE_ENABLE_SED: "${JELLYSCOPE_ENABLE_SED:-false}"restart: unless-stopped
50 unmodified lines51525354555657585960616263646566679 unmodified lines777879808182838485868750 unmodified linesserve-dev:uv run uvicorn jellyscope.web:create_app --factory --reload --host 127.0.0.1 --port 5000# Build the Docker imagedocker-build:docker compose build# Seed the jellyscope-data volume from local ./data (run once)docker-seed:docker run --rm -v jellyscope-data:/data -v "$PWD/data":/src alpine sh -c "cp -r /src/. /data/"# Start the containerized service (detached)docker-up:docker compose up -d# Stop and remove the containerized servicedocker-down:9 unmodified lines# Rebuild image and recreate container (picks up code changes; uses layer cache)docker-reload:docker compose up -d --build# Start dev container with bind-mounted src and uvicorn --reload (hot reload)docker-dev:docker compose -f docker-compose.yml -f docker-compose.dev.yml up# Clean build artifactsclean:50 unmodified lines515253545556575859606162639 unmodified lines737475767778798081828350 unmodified linesserve-dev:uv run uvicorn jellyscope.web:create_app --factory --reload --host 127.0.0.1 --port 5000# Build the Docker image (tagged with pyproject version)docker-build:JELLYSCOPE_VERSION=$(uv version --short 2>/dev/null || echo dev) docker compose build# Start the containerized service (detached)docker-up:JELLYSCOPE_VERSION=$(uv version --short 2>/dev/null || echo dev) docker compose up -d# Stop and remove the containerized servicedocker-down:9 unmodified lines# Rebuild image and recreate container (picks up code changes; uses layer cache)docker-reload:JELLYSCOPE_VERSION=$(uv version --short 2>/dev/null || echo dev) docker compose up -d --build# Start dev container with bind-mounted src and uvicorn --reload (hot reload)docker-dev:JELLYSCOPE_VERSION=$(uv version --short 2>/dev/null || echo dev) docker compose -f docker-compose.yml -f docker-compose.dev.yml up# Clean build artifactsclean:
.dockerignore+26-15
Dockerfile+6
README.md+2-4
docker-compose.dev.yml+6-2
docker-compose.yml+10-16
justfile+5-9