Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker build var to spoof git tag version #1001

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .docker/server_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ ENV UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=/opt/.venv \
UV_PYTHON=python3.10

# Used to fake the version of the package in cases where datalab is only
# available as a git submodule or worktree
ARG SETUPTOOLS_SCM_PRETEND_VERSION
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${SETUPTOOLS_SCM_PRETEND_VERSION}

WORKDIR /app
COPY ./pydatalab/pyproject.toml .
COPY ./pydatalab/uv.lock .
Expand All @@ -29,6 +34,7 @@ WORKDIR /app
# Install the local version of the package and mount the repository data to get version info
COPY ./pydatalab/ ./
RUN git config --global --add safe.directory /

# Install editable mode so that the server runs from a sensible place where we can stuff .env files
RUN --mount=type=bind,target=/.git,source=./.git uv pip install --python /opt/.venv/bin/python --no-deps --editable .

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
dockerfile: .docker/server_dockerfile
args:
- WEB_CONCURRENCY=4
- SETUPTOOLS_SCM_PRETEND_VERSION=${SETUPTOOLS_SCM_PRETEND_VERSION}
depends_on:
- database
restart: unless-stopped
Expand Down