Skip to content

Commit 1d99c5d

Browse files
authored
Merge pull request #63 from pdettori/dockerfile
✨ update Dockerfiles for OpenShift support
2 parents 7f19aa4 + e817bed commit 1d99c5d

12 files changed

Lines changed: 68 additions & 55 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
FROM quay.io/pdettori/python:3.12-slim
2-
3-
RUN apt-get update && apt-get install -y git
4-
5-
COPY --from=ghcr.io/astral-sh/uv:0.6.8 /uv /uvx /bin/
6-
7-
ADD . /app
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
2+
ARG RELEASE_VERSION="main"
83

94
WORKDIR /app
5+
COPY . .
6+
RUN uv sync --no-cache --locked --link-mode copy
107

11-
RUN --mount=type=cache,target=/root/.cache/uv uv sync
8+
ENV PRODUCTION_MODE=True \
9+
RELEASE_VERSION=${RELEASE_VERSION}
1210

13-
ENV PATH="/app/.venv/bin:$PATH"
11+
RUN chown -R 1001:1001 /app
12+
USER 1001
1413

15-
CMD ["uv", "run", ".", "--host", "0.0.0.0", "--port", "8000"]
14+
CMD ["uv", "run", "--no-sync", ".", "--host", "0.0.0.0", "--port", "8000"]

a2a/a2a_contact_extractor/pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
88
"marvin>=3.0.0",
9-
"a2a-sdk>=0.2.5,<0.3.0",
9+
"a2a-sdk>=0.2.5,<0.3.0"
1010
]
1111

1212
[tool.uv.sources]
@@ -15,3 +15,10 @@ a2a-samples = { workspace = true }
1515
[tool.ruff.lint]
1616
extend-select = ["I", "UP"]
1717

18+
[tool.setuptools]
19+
py-modules = ["agent", "agent_executor", "__main__"]
20+
21+
[build-system]
22+
requires = ["setuptools>=80.8"]
23+
build-backend = "setuptools.build_meta"
24+

a2a/a2a_contact_extractor/uv.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
FROM quay.io/pdettori/python:3.12-slim
2-
3-
RUN apt-get update && apt-get install -y git
4-
5-
COPY --from=ghcr.io/astral-sh/uv:0.6.8 /uv /uvx /bin/
6-
7-
ADD . /app
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
2+
ARG RELEASE_VERSION="main"
83

94
WORKDIR /app
5+
COPY . .
6+
RUN uv sync --no-cache --locked --link-mode copy
107

11-
RUN --mount=type=cache,target=/root/.cache/uv uv sync
8+
ENV PRODUCTION_MODE=True \
9+
RELEASE_VERSION=${RELEASE_VERSION}
1210

13-
ENV PATH="/app/.venv/bin:$PATH"
11+
RUN chown -R 1001:1001 /app
12+
USER 1001
1413

15-
CMD ["uv", "run", "app", "--host", "0.0.0.0", "--port", "8000"]
14+
CMD ["uv", "run", "--no-sync", ".", "--host", "0.0.0.0", "--port", "8000"]

a2a/slack_researcher/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

a2a/slack_researcher/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
FROM quay.io/pdettori/python:3.12-slim
2-
3-
RUN apt-get update && apt-get install -y git
4-
5-
COPY --from=ghcr.io/astral-sh/uv:0.6.8 /uv /uvx /bin/
6-
7-
ADD . /app
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
2+
ARG RELEASE_VERSION="main"
83

94
WORKDIR /app
5+
COPY . .
6+
RUN uv sync --no-cache --locked --link-mode copy
107

11-
RUN --mount=type=cache,target=/root/.cache/uv uv sync
8+
ENV PRODUCTION_MODE=True \
9+
RELEASE_VERSION=${RELEASE_VERSION}
1210

13-
ENV PATH="/app/.venv/bin:$PATH"
11+
RUN chown -R 1001:1001 /app
12+
USER 1001
1413

15-
CMD ["uv", "run", "server", "--host", "0.0.0.0", "--port", "8000"]
14+
CMD ["uv", "run", "--no-sync", ".", "--host", "0.0.0.0", "--port", "8000"]

a2a/weather_service/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

a2a/weather_service/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
FROM quay.io/pdettori/python:3.11-slim-bookworm
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
22
ARG RELEASE_VERSION="main"
3-
COPY --from=ghcr.io/astral-sh/uv:0.6.16 /uv /bin/
3+
44
WORKDIR /app
55
COPY . .
66
RUN uv sync --no-cache --locked --link-mode copy
7+
78
ENV PRODUCTION_MODE=True \
89
RELEASE_VERSION=${RELEASE_VERSION}
9-
CMD ["uv", "run", "--no-sync", "server"]
10+
11+
RUN chown -R 1001:1001 /app
12+
USER 1001
13+
14+
CMD ["uv", "run", "--no-sync", ".", "--host", "0.0.0.0", "--port", "8000"]

0 commit comments

Comments
 (0)