mirror of
https://github.com/altstackHQ/altstack-data.git
synced 2026-04-23 17:25:14 +02:00
🤖 Sentinel: Synchronization from aa-humaaan/thealtstack
This commit is contained in:
42
docker-deploy/ollama/Dockerfile
Normal file
42
docker-deploy/ollama/Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
# Dockerfile for Ollama
|
||||
# Stage 1: Build (Ollama is written in Go and requires C++ libs for some runners)
|
||||
FROM golang:1.22-alpine AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
cmake \
|
||||
gcc \
|
||||
g++ \
|
||||
make \
|
||||
linux-headers
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# In a real scenario, you'd clone and build:
|
||||
# RUN git clone https://github.com/ollama/ollama.git . && make
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM alpine:3.19
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup -S ollama && adduser -S ollama -G ollama
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache ca-certificates libstdc++
|
||||
|
||||
# Copy binary (Assuming build success)
|
||||
# COPY --from=builder /build/ollama /usr/local/bin/ollama
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R ollama:ollama /app
|
||||
|
||||
USER ollama
|
||||
|
||||
ENV OLLAMA_HOST=0.0.0.0
|
||||
EXPOSE 11434
|
||||
|
||||
# Start Ollama
|
||||
CMD ["ollama", "serve"]
|
||||
40
docker-deploy/ollama/docker-compose.yml
Normal file
40
docker-deploy/ollama/docker-compose.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
# 🚀 BUILT & MAINTAINED BY THE ALTSTACK
|
||||
# 🌍 https://thealtstack.com
|
||||
# 💡 Open-source deployment templates for modern self-hosting.
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
|
||||
# Docker Compose for Ollama
|
||||
|
||||
services:
|
||||
ollama:
|
||||
image: ollama/ollama:latest # Official image is highly recommended for GPU support
|
||||
container_name: ollama
|
||||
ports:
|
||||
- "11434:11434"
|
||||
volumes:
|
||||
- ollama_data:/root/.ollama
|
||||
# For GPU support (NVIDIA), uncomment the following:
|
||||
# deploy:
|
||||
# resources:
|
||||
# reservations:
|
||||
# devices:
|
||||
# - driver: nvidia
|
||||
# count: all
|
||||
# capabilities: [gpu]
|
||||
networks:
|
||||
- ollama_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:11434/api/tags" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
ollama_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
ollama_data:
|
||||
name: ollama_data
|
||||
75
docker-deploy/ollama/install.sh
Executable file
75
docker-deploy/ollama/install.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
# 🚀 Auto-generated by The AltStack
|
||||
# https://thealtstack.com
|
||||
|
||||
echo "🔵 Starting AltStack Deployment..."
|
||||
|
||||
# 1. Check/Install Docker
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "📦 Docker not found. Installing..."
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sh get-docker.sh
|
||||
rm get-docker.sh
|
||||
echo "✅ Docker installed."
|
||||
else
|
||||
echo "✅ Docker is already installed."
|
||||
fi
|
||||
|
||||
# 2. Setup Directory
|
||||
APP_DIR="ollama-deploy"
|
||||
mkdir -p $APP_DIR
|
||||
cd $APP_DIR
|
||||
echo "📂 Created directory: $APP_DIR"
|
||||
|
||||
# 3. Create docker-compose.yml
|
||||
echo "📄 Writing configuration..."
|
||||
cat << 'INNER_EOF' > docker-compose.yml
|
||||
# -------------------------------------------------------------------------
|
||||
# 🚀 Created and distributed by The AltStack
|
||||
# 🌍 https://thealtstack.com
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# Docker Compose for Ollama
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
ollama:
|
||||
image: ollama/ollama:latest # Official image is highly recommended for GPU support
|
||||
container_name: ollama
|
||||
ports:
|
||||
- "11434:11434"
|
||||
volumes:
|
||||
- ollama_data:/root/.ollama
|
||||
# For GPU support (NVIDIA), uncomment the following:
|
||||
# deploy:
|
||||
# resources:
|
||||
# reservations:
|
||||
# devices:
|
||||
# - driver: nvidia
|
||||
# count: all
|
||||
# capabilities: [gpu]
|
||||
networks:
|
||||
- ollama_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:11434/api/tags" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
ollama_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
ollama_data:
|
||||
name: ollama_data
|
||||
|
||||
INNER_EOF
|
||||
|
||||
# 4. Start Services
|
||||
echo "🚀 Starting services..."
|
||||
docker compose up -d
|
||||
|
||||
echo ""
|
||||
echo "✅ Deployment Complete!"
|
||||
echo "👉 Your ollama stack is running."
|
||||
Reference in New Issue
Block a user