Skip to content

Commit ffd70b3

Browse files
configuring devcontainer to call localhost (#409)
* configuring container to call localhost * fix(pre_commit): 🎨 auto format pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4055a0e commit ffd70b3

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"dockerComposeFile": "./docker-compose.yaml",
44
"service": "devcontainer-roboflow-python",
55
"workspaceFolder": "/roboflow-python",
6+
"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'",
67
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
78
"customizations": {
89
"vscode": {

.devcontainer/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
context: ..
66
dockerfile: Dockerfile.dev
77
image: devcontainer-roboflow-python
8+
extra_hosts:
9+
- "localhost.roboflow.one:host-gateway"
810
volumes:
911
- ..:/roboflow-python
1012
command: sleep infinity

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__/
88
.idea
99
# C extensions
1010
*.so
11+
.devcontainer/certs/
1112

1213
# Distribution / packaging
1314
.Python

Dockerfile.dev

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
FROM python:3.10
2-
RUN apt-get update && apt-get install -y make curl libgl1-mesa-glx && rm -rf /var/lib/apt/lists/*
2+
RUN apt-get update && apt-get install -y make curl libgl1-mesa-glx ca-certificates && rm -rf /var/lib/apt/lists/*
33
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
44
ENV PATH="/root/.local/bin:${PATH}"
55

6+
67
WORKDIR /roboflow-python
78
COPY .devcontainer/bashrc_ext /root/bashrc_ext
89
RUN echo "source /root/bashrc_ext" >> ~/.bashrc
910

11+
# Trust any custom CAs provided in build context (e.g., mkcert)
12+
COPY .devcontainer/certs/ /usr/local/share/ca-certificates/
13+
RUN update-ca-certificates || true
14+
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
15+
ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
16+
17+
1018
COPY ./requirements.txt ./
1119
RUN uv pip install --system -r requirements.txt
1220

0 commit comments

Comments
 (0)