From 743f1823f1d97b13fb766b43bec70f201495799c Mon Sep 17 00:00:00 2001 From: Rodrigo Barbosa Date: Mon, 18 Aug 2025 17:36:59 +0000 Subject: [PATCH 1/2] configuring container to call localhost --- .devcontainer/devcontainer.json | 3 ++- .devcontainer/docker-compose.yaml | 2 ++ .gitignore | 1 + Dockerfile.dev | 10 +++++++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4ca239a8..3f74e1da 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,6 +3,7 @@ "dockerComposeFile": "./docker-compose.yaml", "service": "devcontainer-roboflow-python", "workspaceFolder": "/roboflow-python", + "initializeCommand": "sh -lc 'mkdir -p .devcontainer/certs; if command -v mkcert >/dev/null 2>&1; then CAROOT=\"$(mkcert -CAROOT)\"; if [ -f \"$CAROOT/rootCA.pem\" ]; then cp \"$CAROOT/rootCA.pem\" .devcontainer/certs/mkcert-rootCA.crt; else echo \"[devcontainer] mkcert CA not found at $CAROOT/rootCA.pem; skipping\"; fi; else echo \"[devcontainer] mkcert not installed; skipping CA copy\"; fi'", "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", "customizations": { "vscode": { @@ -16,4 +17,4 @@ } } } -} +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index 2b384ece..231cf405 100644 --- a/.devcontainer/docker-compose.yaml +++ b/.devcontainer/docker-compose.yaml @@ -5,6 +5,8 @@ services: context: .. dockerfile: Dockerfile.dev image: devcontainer-roboflow-python + extra_hosts: + - "localhost.roboflow.one:host-gateway" volumes: - ..:/roboflow-python command: sleep infinity diff --git a/.gitignore b/.gitignore index fdf9d00c..00ea342a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ .idea # C extensions *.so +.devcontainer/certs/ # Distribution / packaging .Python diff --git a/Dockerfile.dev b/Dockerfile.dev index e1d6b9af..1f604c88 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,12 +1,20 @@ FROM python:3.10 -RUN apt-get update && apt-get install -y make curl libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y make curl libgl1-mesa-glx ca-certificates && rm -rf /var/lib/apt/lists/* RUN curl -LsSf https://astral.sh/uv/install.sh | sh ENV PATH="/root/.local/bin:${PATH}" + WORKDIR /roboflow-python COPY .devcontainer/bashrc_ext /root/bashrc_ext RUN echo "source /root/bashrc_ext" >> ~/.bashrc +# Trust any custom CAs provided in build context (e.g., mkcert) +COPY .devcontainer/certs/ /usr/local/share/ca-certificates/ +RUN update-ca-certificates || true +ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt +ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt + + COPY ./requirements.txt ./ RUN uv pip install --system -r requirements.txt From 96f3ce78b1d544d7680ba03335848a5abf419154 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 17:41:25 +0000 Subject: [PATCH 2/2] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3f74e1da..616dce1d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,4 +17,4 @@ } } } -} \ No newline at end of file +}