Skip to content

Commit 0315db4

Browse files
committed
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.
1 parent cce9e1d commit 0315db4

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.dockerignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.*
2+
bump_my_version.egg-info/
3+
docs/
4+
overrides/
5+
test-reports/
6+
tests/
7+
tools/
8+
*.yaml
9+
CODEOWNERS
10+
Dockerfile
11+
Makefile
12+
MANIFEST.in

.github/dependabot.yml

+5
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ updates:
1111
- "*" # Group all Actions updates into a single larger pull request
1212
schedule:
1313
interval: weekly
14+
15+
- package-ecosystem: docker
16+
directory: /
17+
schedule:
18+
interval: "daily" # Update Docker tags daily

Dockerfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
2+
3+
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
4+
5+
WORKDIR /app
6+
7+
COPY pyproject.toml /app/pyproject.toml
8+
COPY uv.lock /app/uv.lock
9+
10+
RUN --mount=type=cache,target=/root/.cache/uv \
11+
# --mount=type=bind,source=uv.lock,target=uv.lock \
12+
# --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
13+
uv sync --frozen --no-install-project --no-dev
14+
ADD . /app
15+
RUN --mount=type=cache,target=/root/.cache/uv \
16+
uv sync --frozen --no-dev
17+
18+
FROM python:3.12-slim-bookworm
19+
20+
ARG USERNAME=app
21+
ARG USER_UID=1000
22+
ARG USER_GID=$USER_UID
23+
24+
# Add a non-root user and group
25+
RUN groupadd --gid $USER_GID $USERNAME \
26+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
27+
28+
COPY --from=builder --chown=$USER_UID:$USER_GID /app /app
29+
USER $USERNAME
30+
WORKDIR /project
31+
32+
# Place executables in the environment at the front of the path
33+
ENV PATH="/app/.venv/bin:$PATH"
34+
35+
ENTRYPOINT ["bump-my-version"]

0 commit comments

Comments
 (0)