improvement: use uv in docker (#4475)

Switch to `uv` in docker for faster installation
This commit is contained in:
Myles Scolnick
2025-04-10 17:41:40 -07:00
committed by GitHub
parent 7049cb8e29
commit 02c451f09e
3 changed files with 30 additions and 6 deletions

View File

@@ -9,9 +9,10 @@ RUN useradd -m appuser
WORKDIR /app WORKDIR /app
ARG marimo_version=0.8.15 ARG marimo_version=0.12.8
ENV MARIMO_SKIP_UPDATE_CHECK=1 ENV MARIMO_SKIP_UPDATE_CHECK=1
RUN pip install --no-cache-dir marimo==${marimo_version} && \ ENV UV_SYSTEM_PYTHON=1
RUN uv pip install --no-cache-dir marimo==${marimo_version} && \
mkdir -p /app/data && \ mkdir -p /app/data && \
chown -R appuser:appuser /app chown -R appuser:appuser /app
@@ -29,10 +30,10 @@ CMD marimo edit --no-token -p $PORT --host $HOST
# -data entry point # -data entry point
FROM base AS data FROM base AS data
RUN pip install --no-cache-dir altair pandas numpy RUN uv pip install --no-cache-dir marimo[recommended,lsp] altair pandas numpy
CMD marimo edit --no-token -p $PORT --host $HOST CMD marimo edit --no-token -p $PORT --host $HOST
# -sql entry point, extends -data # -sql entry point, extends -data
FROM data AS sql FROM data AS sql
RUN pip install --no-cache-dir marimo[sql] RUN uv pip install --no-cache-dir marimo[recommended,lsp,sql]
CMD marimo edit --no-token -p $PORT --host $HOST CMD marimo edit --no-token -p $PORT --host $HOST

23
docker/README.md Normal file
View File

@@ -0,0 +1,23 @@
# Docker Images
This directory contains the Dockerfile for building marimo Docker images.
## Available Images
- `marimo-slim`: Minimal image with just marimo installed
- `marimo-data`: Includes marimo plus data science packages (pandas, numpy, altair) and marimo[recommended,lsp]
- `marimo-sql`: Extends the data image with SQL support (marimo[recommended,lsp,sql])
## Testing locally
To build all images, from the root
```bash
# Build your image, and tag it as my_app
docker build -t my_app . -f docker/Dockerfile
# Start your container, mapping port 8080
docker run -p 8080:8080 -it my_app
# Visit http://localhost:8080
```

View File

@@ -7,8 +7,8 @@ You can find the containers and tags on [marimo's GitHub packages page](https://
We provide the following variants: We provide the following variants:
- `marimo:latest` - The latest version of marimo - `marimo:latest` - The latest version of marimo
- `marimo:latest-data` - The latest version of marimo with `altair`, `pandas`, and `numpy` preinstalled. - `marimo:latest-data` - The latest version of marimo with `marimo[recommended,lsp]`, `altair`, `pandas`, and `numpy` preinstalled.
- `marimo:latest-sql` - The latest version of marimo with `marimo[sql]` and `duckdb` preinstalled. - `marimo:latest-sql` - The latest version of marimo with `marimo[recommended,lsp,sql]` preinstalled.
or any particular version of marimo; for example, `marimo:0.8.3`, `marimo:0.8.3-data`, `marimo:0.8.3-sql`. or any particular version of marimo; for example, `marimo:0.8.3`, `marimo:0.8.3-data`, `marimo:0.8.3-sql`.