-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 981 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM jupyter/datascience-notebook:latest
USER root
# Install uv, the new fast Python package installer
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
WORKDIR /home/jovyan/city2graph
# Install dependencies using uv sync, leveraging Docker layer caching.
# This installs dependencies from pyproject.toml into a separate layer
# before the application code is copied, improving build times.
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --system --extra cpu --group dev --no-install-project
# Copy the rest of the application code
COPY . .
# Install the project in editable mode. Dependencies are already installed, so this is fast.
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --system --extra cpu --group dev
# Ensure the jovyan user owns the files
RUN chown -R jovyan:users /home/jovyan/city2graph
# Switch back to the non-root user
USER jovyan
EXPOSE 8888