Fix/dependencies conflict and dockerfile image versions#1
Conversation
FastAPI depends on Starlette and Pydantic Because of that, FastAPI will download the correct versions based on the selected FastAPI verion. Removing pydantic, and starlette from the list will make sure that when FastAPI is installed the correct version dependencies are going to be added... Similar with case explained above, Pydantic has 3 dependencies: - pydantic-core - typing_extensions - annotated-types All of them are being removed from the list of required dependencies, because FastAPI when downloading Pydantic for its own dependcy, will add Pydantic dependencies as well... Similarly, Uvicorn has dependies on click and h11. Both of which are being removed from the list, for same reasons explained above... > **Except** for **uvloop**, UVloop is a asyncio library that is used by default from uvicorn, however it is only used when present... Otherwise, the default asyncio is used. And for this reason, uvloop is listed in the required dependencies... > For Uvicorn version 0.32.1, uvloop must be >= 0.14.0, !=0.15.0, != 0.15.1. As per [uvicorn pyproject.toml 0.32.1](Kludex/uvicorn@0.32.0...0.32.1#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711) > The httptools==0.6.1 is listed in the same file mentioned above as imcompatible with Uvicorn 0.32.1. Hence why it is also removed from the list. It is also an optional depency. Beucase idna and anyio are also dependencies used from higher level depencies they are being commented out from the requirements.txt
- changed :debug-nonroot image with :nonroot to reduce RCE attack surface. - added correct image versions for python images to keep away version conflicts. - added upgrade pip command just for the sake of it. - added a new stage to separate the cURL install from the pip install to increase build time when developing...
- pull_request comment permission for the scout action - username and password for docker hub using github secrets for authentication need to use scout - scout now only runs on Pull requests
…and missing/wrong params
Overview
Labels (8 changes)
+org.opencontainers.image.created=2026-02-16T03:23:14.466Z
+org.opencontainers.image.description=Um sistema criado para testar como funciona uma API criada por FastAPI, que recebe eventoss do GitLab quando uma issue for criada. De forma segura, e que consiga processar esses dados.
+org.opencontainers.image.licenses=
+org.opencontainers.image.revision=1a220b50b9212baeea420b0f1ca6135b74cc4337
+org.opencontainers.image.source=https://github.com/LuisDevLipe/LzLuscas-gitlab-webhook-agent
+org.opencontainers.image.title=LzLuscas-gitlab-webhook-agent
+org.opencontainers.image.url=https://github.com/LuisDevLipe/LzLuscas-gitlab-webhook-agent
+org.opencontainers.image.version=pr-1 |
🔍 Vulnerabilities of
|
| digest | sha256:0c554c9b807fb8278fe74a7e1399fa1ef4d6fbb1eb4725f27fa01946b333bb3a |
| vulnerabilities | |
| platform | linux/amd64 |
| size | 42 MB |
| packages | 85 |
📦 Base Image gcr.io/distroless/static:nonroot
| digest | sha256:66e7173f385da0ba1311e42b21d366b7dc1de213e78e7df170ca9eb14bc04c4f |
| vulnerabilities |
Description
Description
|
Recommended fixes for image
|
| Digest | |
| Vulnerabilities | |
| Size | 0 B |
| Packages | 0 |
Refresh base image
Rebuild the image using a newer base image version. Updating this may result in breaking changes.✅ This image version is up to date.
Change base image
✅ There are no tag recommendations at this time.
…formation about the cves, and recommendations for the built image. As well as comparing it with the latest on the repo
Adciona GitHub Actions Workflow para Build, Publish and Scout da imagem Docker
Essa PR adiciona ao repositório um fluxo de trabalho no GitHub para construir a imagem Docker deste projeto utilizando os runners do GitHub.
O fluxo de trabalho é executado quando um novo commit é feito na branch
maine quando um novo commit é feito em umaPull Request.Main branch
Quando o Fluxo está sendo executado na branch
mainele apenas constrói a imagem Docker e a armazena no GitHub Packages.Pull Requests
Quando o Fluxo está sendo executado em uma
Pull Requestele apenas constrói a imagem, e então executa o Docker Scout.O Docker scout realizará comentários no Pull Request infomando vulnerabilidades encontradas nos pacotes e na imagem base, recomendações, e uma visão geral comparando a imagem construída na PR e a última imagem salva no repositório.
Copilot PR Summary Overview
This pull request improves the Docker build process and enhances security checks for the project. The main changes are updates to the Dockerfile for dependency management and image composition, as well as enhancements to the GitHub Actions workflow to integrate vulnerability scanning and recommendations using Docker Scout.
Dockerfile improvements:
python:3.13.5, and split the build process into separatebuilderanddepsstages for better dependency management and caching. Also, ensured pip, setuptools, and wheel are upgraded before installing dependencies.gcr.io/distroless/python3-debian13:nonrootinstead of the debug variant, and adjusted theCOPYcommand to sourcecurlfrom the newdepsstage, improving security and image cleanliness. [1] [2]GitHub Actions workflow enhancements:
pull-requests: writepermission to the workflow to enable PR-specific actions.This pull request updates the Docker build process for the application, focusing on improving dependency management, image layering, and permissions. The most important changes are grouped below:
Dependency and build improvements:
python:3.13topython:3.13.5to ensure the latest patch is used.pip,setuptools, andwheel, and moved the installation of dependencies to a dedicatedbuilderstage for better reproducibility.depsstage to separate dependency installation and external tool setup, improving image layering and clarity.Runtime and permissions changes:
debug-nonroottononrootfor improved security and reduced image size.COPYcommand forcurlto copy from the newdepsstage instead ofbuilder, ensuring correct permissions and user ownership in the runtime image.