forked from linkml/linkml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 914 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 914 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
31
32
33
34
35
36
37
FROM python:3.12-bookworm AS builder
# https://stackoverflow.com/questions/53835198/integrating-python-poetry-with-docker
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
UV_VERSION=0.7.13
# Install uv
RUN pip install "uv==$UV_VERSION"
WORKDIR /code
# Build project. The .git directory is needed for uv-dynamic-versioning
COPY . .
RUN uv build
#######################################
FROM python:3.12-slim-bookworm AS runner
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt update && apt install -y gcc musl-dev python3-dev && rm -rf /var/lib/apt/lists/*
COPY --from=builder /code/dist/*.whl /tmp/linkml-whl/
RUN pip install /tmp/linkml-whl/*.whl
RUN useradd --create-home linkmluser
WORKDIR /home/linkmluser
USER linkmluser
# command to run on container start
CMD [ "bash" ]