-
-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathDockerfile.uv
More file actions
37 lines (29 loc) · 1.09 KB
/
Dockerfile.uv
File metadata and controls
37 lines (29 loc) · 1.09 KB
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
31
32
33
34
35
36
37
ARG BASE_IMAGE=trame-common
FROM ${BASE_IMAGE}
# This is just the Python version that will be used in the root Python
# venv (required by the build step). The Python version used by
# applications can be set elsewhere by overriding the `TRAME_VENV`
# environment variable.
ARG PYTHON_VERSION=3.13
ENV UV_ROOT_VENV=/home/trame-user/root_venv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Copy the uv scripts into place
COPY scripts/uv/* /opt/trame/
# uv config envs
ENV UV_NO_CACHE=1
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ENV VIRTUAL_ENV=/deploy/server/venv
ENV TRAME_PYTHON=${PYTHON_VERSION}
# Set venv paths
ENV TRAME_VENV=$VIRTUAL_ENV
ENV PV_VENV=$VIRTUAL_ENV
ENV VTK_VENV=$VIRTUAL_ENV
# Set up the root venv (for things like pyyaml).
# Have to use `gosu` to create the venv so that python will be
# installed somewhere that is accessible to trame-user
RUN gosu trame-user uv venv --python ${PYTHON_VERSION} $UV_ROOT_VENV
# Put the uv root dir in the path
ENV PATH=$UV_ROOT_VENV/bin:$PATH
# Install build dependencies in the root environment
RUN gosu trame-user uv pip install PyYAML wheel