Add nginx proxy for Ollama with bridge network

- Add nginx proxy to forward localhost:11434 to host's Ollama
- Use bridge network for godex container isolation
- Add host.docker.internal for host service access
- Update install-docker.sh to download nginx.conf
This commit is contained in:
Cheikh Seck committed 2026-03-25 23:46:47 +00:00
1 parent 759d960a96
commit 3e240710eb
4 files changed
+45 -3

No files matched your search

+1
View File
@@ -340,6 +340,7 @@ The sandbox includes:
- Root filesystem is read-only
- `/tmp` and `/run` use tmpfs (memory-only, non-persistent)
- Process and file limits enforced
- Network isolated via nginx proxy (Ollama accessible at localhost:11434)
- Provider credentials are stored in the `godex-config` volume
- Use `docker compose down -v` to completely remove all data
+20 -3
View File
@@ -1,4 +1,17 @@
services:
ollama-proxy:
image: nginx:alpine
container_name: ollama-proxy
restart: unless-stopped
ports:
- "11434:11434"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- godex-network
depends_on:
- godex
godex:
build:
context: .
@@ -14,9 +27,12 @@ services:
stdin_open: true
tty: true
restart: "no"
networks:
- godex-network
extra_hosts:
- "host.docker.internal:host-gateway"
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
- /run
@@ -32,5 +48,6 @@ services:
soft: 256
hard: 256
volumes:
godex-config:
networks:
godex-network:
driver: bridge
+3
View File
@@ -22,6 +22,9 @@ curl -fsSL "${GITHUB_REPO}/Dockerfile" -o Dockerfile
echo "Downloading docker-compose.yml..."
curl -fsSL "${GITHUB_REPO}/docker-compose.yml" -o docker-compose.yml
echo "Downloading nginx.conf..."
curl -fsSL "${GITHUB_REPO}/nginx.conf" -o nginx.conf
echo ""
echo "Setup complete!"
echo ""
+21
View File
@@ -0,0 +1,21 @@
events {
worker_connections 1024;
}
http {
server {
listen 11434;
location / {
proxy_pass http://host.docker.internal:11434;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Connection "";
proxy_buffering off;
# Ollama streaming support
proxy_cache off;
chunked_transfer_encoding on;
}
}
}