Skip to content

Commit 61ffaa7

Browse files
committed
hf spaces integration
1 parent 1c45903 commit 61ffaa7

1 file changed

Lines changed: 10 additions & 20 deletions

File tree

Dockerfile

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
1-
# uv base image
2-
FROM python:3.11-slim-bookworm
1+
FROM python:3.12-slim
32

4-
# Install uv for fast dependency management
5-
COPY --from=ghcr.io/astral-sh/uv:0.8.13 /uv /uvx /bin/
3+
# Install uv
4+
COPY --from=ghcr.io/astral-sh/uv:0.8.13 /usr/local/bin/uv /usr/local/bin/
65

7-
# Set the working directory
86
WORKDIR /app
97

10-
# Copy dependency files first to leverage Docker layer caching
8+
# Install dependencies
119
COPY pyproject.toml uv.lock ./
10+
RUN uv sync --frozen --no-dev --system
1211

13-
# Install dependencies using uv
14-
RUN uv sync --frozen --no-dev
12+
# Copy app
13+
COPY apps/ .
1514

16-
# Copy the marimo notebook file
17-
COPY apps/ notebooks/
15+
# Default notebook
16+
ENV MARIMO_NOTEBOOK=gs_process.py
1817

19-
# env. variable to define notebook to run (will be overriden by render at runtime)
20-
ENV MARIMO_NOTEBOOK="notebooks/gram_schmidt_process.py"
21-
22-
# Expose the marimo port
2318
EXPOSE 2718
2419

25-
# Run the notebook through shell command
26-
CMD ["sh", "-c", "uv run marimo run ${MARIMO_NOTEBOOK:?Set MARIMO_NOTEBOOK} --host 0.0.0.0 --port 2718"]
27-
28-
29-
# Advancements:
30-
# 3. make it well-define
20+
CMD ["sh", "-c", "uv run marimo run ${MARIMO_NOTEBOOK:-gs_process.py} --host 0.0.0.0 --port 2718"]

0 commit comments

Comments
 (0)