Skip to content

Commit f888426

Browse files
authored
feat - support repos with self-signed ca-s (#206)
* support repos with self-signed ca-s * whoops - missed that while debugging
1 parent 10b6888 commit f888426

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ yarn-error.log*
6464
next-env.d.ts
6565

6666
.idea/
67+
68+
# ignore adding self-signed certs
69+
certs/

Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# syntax=docker/dockerfile:1-labs
22

3-
FROM node:20-alpine AS node_base
3+
# Build argument for custom certificates directory
4+
ARG CUSTOM_CERT_DIR="certs"
5+
6+
FROM node:20-alpine3.22 AS node_base
47

58
FROM node_base AS node_deps
69
WORKDIR /app
@@ -37,6 +40,7 @@ RUN apt-get update && apt-get install -y \
3740
curl \
3841
gnupg \
3942
git \
43+
ca-certificates \
4044
&& mkdir -p /etc/apt/keyrings \
4145
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
4246
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
@@ -45,6 +49,18 @@ RUN apt-get update && apt-get install -y \
4549
&& apt-get clean \
4650
&& rm -rf /var/lib/apt/lists/*
4751

52+
# Update certificates if custom ones were provided and copied successfully
53+
RUN if [ -n "${CUSTOM_CERT_DIR}" ]; then \
54+
mkdir -p /usr/local/share/ca-certificates && \
55+
if [ -d "${CUSTOM_CERT_DIR}" ]; then \
56+
cp -r ${CUSTOM_CERT_DIR}/* /usr/local/share/ca-certificates/ 2>/dev/null || true; \
57+
update-ca-certificates; \
58+
echo "Custom certificates installed successfully."; \
59+
else \
60+
echo "Warning: ${CUSTOM_CERT_DIR} not found. Skipping certificate installation."; \
61+
fi \
62+
fi
63+
4864
ENV PATH="/opt/venv/bin:$PATH"
4965

5066
# Copy Python dependencies

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ If `DEEPWIKI_AUTH_MODE` is not set or is set to `false` (or any other value than
324324

325325
You can use Docker to run DeepWiki:
326326

327+
#### Running the Container
328+
327329
```bash
328330
# Pull the image from GitHub Container Registry
329331
docker pull ghcr.io/asyncfuncai/deepwiki-open:latest
@@ -400,6 +402,22 @@ docker run -p 8001:8001 -p 3000:3000 \
400402
deepwiki-open
401403
```
402404

405+
#### Using Self-Signed Certificates in Docker
406+
407+
If you're in an environment that uses self-signed certificates, you can include them in the Docker build:
408+
409+
1. Create a directory for your certificates (default is `certs` in your project root)
410+
2. Copy your `.crt` or `.pem` certificate files into this directory
411+
3. Build the Docker image:
412+
413+
```bash
414+
# Build with default certificates directory (certs)
415+
docker build .
416+
417+
# Or build with a custom certificates directory
418+
docker build --build-arg CUSTOM_CERT_DIR=my-custom-certs .
419+
```
420+
403421
### API Server Details
404422

405423
The API server provides:

0 commit comments

Comments
 (0)