diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4ca239a8..616dce1d 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": { 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