Skip to content

Commit 708b10e

Browse files
committed
1 parent f1323df commit 708b10e

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 5.0.0a1-3-g32c6c7b
2+
_commit: 5.0.0a1-4-g7659ef5
33
_src_path: https://github.com/DiamondLightSource/python-copier-template.git
44
author_email: tom.cobb@diamond.ac.uk
55
author_name: Tom Cobb

.devcontainer/devcontainer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
"remoteEnv": {
99
// Allow X11 apps to run inside the container
1010
"DISPLAY": "${localEnv:DISPLAY}",
11-
// We put venv on a different volume to cache so have to copy
12-
"UV_LINK_MODE": "copy",
1311
// Do the equivalent of "activate" the venv so we don't have to "uv run" everything
1412
"PATH": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin:${containerEnv:PATH}"
1513
},

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:noble AS developer
44

55
# Add any system dependencies for the developer/build environment here
6-
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
RUN apt-get update -y && apt-get install -y --no-install-recommends \
77
graphviz \
88
&& apt-get dist-clean
99

@@ -16,6 +16,9 @@ WORKDIR /app
1616
COPY . /app
1717
RUN chmod o+wrX .
1818

19+
# Tell uv sync to install python in a known location so we can copy it out later
20+
ENV UV_PYTHON_INSTALL_DIR=/python
21+
1922
# Sync the project without its dev dependencies
2023
RUN --mount=type=cache,target=/root/.cache/uv \
2124
uv sync --locked --no-editable --no-dev
@@ -36,6 +39,7 @@ RUN sed -i 's/files/ldap files/g' /etc/nsswitch.conf
3639
# Make editable and debuggable
3740
RUN uv pip install debugpy
3841
RUN uv pip install -e .
42+
ENV PATH=/app/.venv/bin:$PATH
3943

4044
# Alternate entrypoint to allow devcontainer to attach
4145
ENTRYPOINT [ "/bin/bash", "-c", "--" ]
@@ -46,10 +50,13 @@ CMD [ "while true; do sleep 30; done;" ]
4650
FROM ubuntu:noble AS runtime
4751

4852
# Add apt-get system dependecies for runtime here if needed
49-
# RUN apt-get update && apt-get install -y --no-install-recommends \
53+
# RUN apt-get update -y && apt-get install -y --no-install-recommends \
5054
# some-library \
5155
# && apt-get dist-clean
5256

57+
# Copy the python installation from the build stage
58+
COPY --from=build /python /python
59+
5360
# Copy the environment, but not the source code
5461
COPY --from=build /app/.venv /app/.venv
5562
ENV PATH=/app/.venv/bin:$PATH

0 commit comments

Comments
 (0)