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/gpt4all/Dockerfile
Normal file
42
docker-deploy/gpt4all/Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
# Dockerfile for GPT4All (Server Implementation)
|
||||
# Stage 1: Build
|
||||
FROM python:3.11-slim-bookworm AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Install GPT4All Python bindings (which provides the API server)
|
||||
RUN pip install --no-cache-dir gpt4all
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM python:3.11-slim-bookworm
|
||||
|
||||
# Create non-root user
|
||||
RUN groupadd -r gpt4all && useradd -r -g gpt4all gpt4all
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy python packages from builder
|
||||
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||
|
||||
# Environment variables for model path
|
||||
ENV MODEL_PATH=/app/models
|
||||
RUN mkdir -p ${MODEL_PATH} && chown -R gpt4all:gpt4all /app
|
||||
|
||||
# GPT4All uses models; we should use a host volume for these or download them.
|
||||
# The volume will be defined in docker-compose.
|
||||
|
||||
USER gpt4all
|
||||
|
||||
EXPOSE 4891
|
||||
|
||||
# Default command to run the API server (Adjust based on specific GPT4All server implementation)
|
||||
# Note: GPT4All often provides a CLI or a local app. This represents a server wrapper.
|
||||
CMD ["python", "-m", "gpt4all.api"]
|
||||
35
docker-deploy/gpt4all/docker-compose.yml
Normal file
35
docker-deploy/gpt4all/docker-compose.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
# 🚀 BUILT & MAINTAINED BY THE ALTSTACK
|
||||
# 🌍 https://thealtstack.com
|
||||
# 💡 Open-source deployment templates for modern self-hosting.
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
|
||||
# Docker Compose for GPT4All
|
||||
|
||||
services:
|
||||
gpt4all:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: gpt4all-server
|
||||
ports:
|
||||
- "4891:4891"
|
||||
volumes:
|
||||
- gpt4all_models:/app/models
|
||||
networks:
|
||||
- gpt4all_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:4891/v1/models" ] # GPT4All local API endpoint
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
gpt4all_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
gpt4all_models:
|
||||
name: gpt4all_models
|
||||
70
docker-deploy/gpt4all/install.sh
Executable file
70
docker-deploy/gpt4all/install.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/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="gpt4all-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 GPT4All
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
gpt4all:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: gpt4all-server
|
||||
ports:
|
||||
- "4891:4891"
|
||||
volumes:
|
||||
- gpt4all_models:/app/models
|
||||
networks:
|
||||
- gpt4all_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:4891/v1/models" ] # GPT4All local API endpoint
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
gpt4all_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
gpt4all_models:
|
||||
name: gpt4all_models
|
||||
|
||||
INNER_EOF
|
||||
|
||||
# 4. Start Services
|
||||
echo "🚀 Starting services..."
|
||||
docker compose up -d
|
||||
|
||||
echo ""
|
||||
echo "✅ Deployment Complete!"
|
||||
echo "👉 Your gpt4all stack is running."
|
||||
Reference in New Issue
Block a user