mirror of
https://github.com/altstackHQ/altstack-data.git
synced 2026-04-20 07:53:32 +02:00
feat: add 65 production-ready docker-compose configurations for self-hosting
This commit is contained in:
42
deployments/ollama/Dockerfile
Normal file
42
deployments/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"]
|
||||
Reference in New Issue
Block a user