mirror of
https://github.com/furyhawk/home_stack.git
synced 2026-07-21 02:06:47 +00:00
feat: update Dockerfile and docker-compose for improved networking and add new make targets for Ollama builds
This commit is contained in:
@@ -9,6 +9,8 @@ ENV OLLAMA_HOST=0.0.0.0
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
ca-certificates \
|
||||
wget \
|
||||
gnupg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Ollama
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
services:
|
||||
ollama:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
network: host
|
||||
image: localhost/ollama-server:latest
|
||||
ports:
|
||||
- "11434:11434" # Map host port 11434 to container port 11434 (Ollama default)
|
||||
@@ -11,6 +13,7 @@ services:
|
||||
environment:
|
||||
- OLLAMA_HOST=0.0.0.0
|
||||
restart: unless-stopped
|
||||
network_mode: slirp4netns
|
||||
# Uncomment the following lines if you have NVIDIA GPU support
|
||||
# deploy:
|
||||
# resources:
|
||||
|
||||
@@ -96,6 +96,8 @@ help:
|
||||
@echo " make ai-launcher Interactive AI backend launcher (recommended for new users)"
|
||||
@echo ""
|
||||
@echo "Ollama-specific targets:"
|
||||
@echo " make ollama-build Build Ollama container with no cache (using slirp4netns)"
|
||||
@echo " make ollama-build-host Build Ollama container with host networking (alternative)"
|
||||
@echo " make ollama-up Start only the Ollama container"
|
||||
@echo " make ollama-down Stop only the Ollama container"
|
||||
@echo " make ollama-logs View Ollama container logs"
|
||||
@@ -135,6 +137,14 @@ info:
|
||||
podman compose --env-file $(ENV_FILE) -f docker-compose.yml -f docker-compose.override.yml config
|
||||
|
||||
# Ollama-specific targets
|
||||
ollama-build:
|
||||
cd ai_stack/ollama && DOCKER_BUILDKIT=0 CONTAINERS_NETNS=slirp4netns podman compose build --no-cache
|
||||
@echo "Ollama container built with no cache. Use 'make ollama-up' to start it."
|
||||
|
||||
ollama-build-host:
|
||||
cd ai_stack/ollama && DOCKER_BUILDKIT=0 podman build --network=host --no-cache -t localhost/ollama-server:latest .
|
||||
@echo "Ollama container built with host networking. Use 'make ollama-up' to start it."
|
||||
|
||||
ollama-up:
|
||||
cd ai_stack/ollama && podman compose up -d
|
||||
@echo "Ollama container started. Use 'make pull-deepseek-model' to download and load the DeepSeek model."
|
||||
|
||||
Reference in New Issue
Block a user