-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker support and configure Dependabot for Docker updates
Introduce a Dockerfile for containerized environments and add a .dockerignore file to exclude unnecessary files. Also, update dependabot.yml to include daily checks for Docker image updates.
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.* | ||
bump_my_version.egg-info/ | ||
docs/ | ||
overrides/ | ||
test-reports/ | ||
tests/ | ||
tools/ | ||
*.yaml | ||
CODEOWNERS | ||
Dockerfile | ||
Makefile | ||
MANIFEST.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder | ||
|
||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy | ||
|
||
WORKDIR /app | ||
|
||
COPY pyproject.toml /app/pyproject.toml | ||
COPY uv.lock /app/uv.lock | ||
|
||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
# --mount=type=bind,source=uv.lock,target=uv.lock \ | ||
# --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync --frozen --no-install-project --no-dev | ||
ADD . /app | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
uv sync --frozen --no-dev | ||
|
||
FROM python:3.12-slim-bookworm | ||
|
||
ARG USERNAME=app | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Add a non-root user and group | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME | ||
|
||
COPY --from=builder --chown=$USER_UID:$USER_GID /app /app | ||
USER $USERNAME | ||
WORKDIR /project | ||
|
||
# Place executables in the environment at the front of the path | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
|
||
ENTRYPOINT ["bump-my-version"] |