File tree Expand file tree Collapse file tree 3 files changed +27
-15
lines changed
Expand file tree Collapse file tree 3 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 11FROM postgres
22
3- # Install git
3+ # Install python
44RUN apt-get update && \
5- apt-get install -y python3 python3-venv && \
5+ apt-get install -y python3 && \
66 apt-get clean && \
77 rm -rf /var/lib/apt/lists/*
88
9+ # Install uv
10+ COPY --from=ghcr.io/astral-sh/uv:0.9.3 /uv /uvx /bin/
11+
912WORKDIR /app
1013
11- # Copy necessary files and folders
14+ # Install python dependencies, only copying necessary files
1215COPY ./pyproject.toml MANIFEST.in ./
13- COPY ./grader_service ./grader_service
14- # Create a virtual environment
15- RUN python3 -m venv /venv
16+ RUN --mount=type=cache,target=/root/.cache/uv \
17+ uv sync --no-dev
1618
17- # Activate venv and install the package
18- RUN /venv/bin/pip install .
19+ # Copy the project files and install the package itself
20+ COPY ./grader_service ./grader_service
21+ RUN --mount=type=cache,target=/root/.cache/uv \
22+ uv pip install .
1923
2024CMD ["sh", "-c", "/app/init-db-postgres.sh"]
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ WORKDIR /app
1010
1111ENV JUPYTERHUB_CRYPT_KEY=e3f92a0d5e37446c7e894a2ef6c6ec3bcb4aa3c38d2a442eb567adf780597aa0
1212
13- RUN pip install grader_labextension
14-
13+ RUN python3 -m pip install grader_labextension
1514RUN python3 -m pip install dockerspawner oauthenticator
1615
1716CMD ["jupyterhub", "-f", "/app/jupyterhub_config.py"]
Original file line number Diff line number Diff line change 11FROM python:3.13-slim
22
3- # Install git
3+ # Install git and sqlite
44RUN apt-get update && \
55 apt-get install -y git sqlite3 && \
66 apt-get clean && \
77 rm -rf /var/lib/apt/lists/*
88
9+ # Install uv
10+ COPY --from=ghcr.io/astral-sh/uv:0.9.3 /uv /uvx /bin/
11+ ENV UV_SYSTEM_PYTHON=true
12+
913WORKDIR /app
1014
11- # Copy necessary files and folders
15+ # Install python dependencies, only copying necessary files
1216COPY ./pyproject.toml MANIFEST.in ./
13- COPY ./grader_service ./grader_service
17+ RUN uv pip compile pyproject.toml -o requirements.txt
18+ RUN --mount=type=cache,target=/root/.cache/uv \
19+ uv pip install -r requirements.txt && \
20+ uv pip install numpy ipykernel
1421
15- RUN pip install .
16- RUN pip install numpy ipykernel
22+ # Copy the project files and install the package itself
23+ COPY ./grader_service ./grader_service
24+ RUN --mount=type=cache,target=/root/.cache/uv \
25+ uv pip install .
1726
1827# Set default branch to main and default user
1928RUN git config --global init.defaultBranch main && \
You can’t perform that action at this time.
0 commit comments