-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 1.11 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (29 loc) · 1.11 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
# --------------------------------------------------------------
# Base Python container image for all Verse Python applications.
#
# This image installs shared dependencies and sets up the environment
# consistently for all apps under the `apps/` folder.
#
# Individual app Dockerfiles should inherit from this base image,
# copy only their application-specific code, and define their runtime commands.
#
# As a result, having a separate `apps/Dockerfile` that duplicates
# base setup is redundant and can be removed for simplicity.
#
# Note: This image uses a non-root user (`verse`) for better security.
# --------------------------------------------------------------
FROM python:3.11.9-slim-bookworm
RUN addgroup --gid 1001 verse
RUN adduser --uid 1001 --ingroup verse verse
USER verse:verse
WORKDIR /app
COPY --chown=verse:verse pyproject.toml pyproject.toml
COPY --chown=verse:verse lib/verse/ lib/verse/
ENV PYTHONPATH=lib/
ENV VIRTUAL_ENV=.local
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install --upgrade pip
RUN pip install uv
RUN uv pip install -r pyproject.toml
RUN rm pyproject.toml