Skip to content

Commit

Permalink
Reverting to 3.10 Docker to support syntax etc - can't get distroless…
Browse files Browse the repository at this point in the history
… to work
  • Loading branch information
PeterBaker0 committed Jul 21, 2024
1 parent e197469 commit d91788f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .Dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
action.yml
dev-requirements.txt
LICENSE
mypy.ini
.github
19 changes: 3 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
FROM python:3-slim AS builder

FROM python:3.10.14-slim-bullseye
WORKDIR /app

# Just dependencies to minimise rebuilds
COPY requirements.txt .

# We are installing a dependency here directly into our app source dir
RUN pip install --target=/app -r requirements.txt

RUN pip install -r requirements.txt
ADD . /app

# A distroless container image with Python and some basics like SSL certificates
# https://github.com/GoogleContainerTools/distroless
FROM gcr.io/distroless/python3-debian10
COPY --from=builder /app /app
WORKDIR /app
ENV PYTHONPATH /app
CMD ["/app/main.py"]
CMD ["python", "/app/main.py"]
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def update_details_of_item(

# Get correct domain info update model
domain_info_model = SUBTYPE_TO_DOMAIN_INFO.get(subtype)
assert domain_info_model, f"Unexpected missing domain info model for {subtype = }."
assert domain_info_model, f"Unexpected missing domain info model for {subtype}."
update_payload = domain_info_model.parse_obj(merged_metadata)
print(update_payload.dict())

Expand Down

0 comments on commit d91788f

Please sign in to comment.