Add Docker Compose and Dockerfile
This commit is contained in:
+13
-32
@@ -1,40 +1,21 @@
|
|||||||
# Git
|
__pycache__/
|
||||||
.git
|
*.pyc
|
||||||
.gitignore
|
*.pyo
|
||||||
|
*.pyd
|
||||||
# Python
|
|
||||||
__pycache__
|
|
||||||
*.py[cod]
|
|
||||||
*$py.class
|
|
||||||
*.so
|
|
||||||
.Python
|
.Python
|
||||||
venv/
|
*.so
|
||||||
.venv/
|
*.egg
|
||||||
env/
|
|
||||||
.env
|
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
dist/
|
dist/
|
||||||
build/
|
build/
|
||||||
|
.git/
|
||||||
# IDE
|
.gitignore
|
||||||
.vscode/
|
|
||||||
.idea/
|
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
|
|
||||||
# Testing
|
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
.coverage
|
.coverage
|
||||||
htmlcov/
|
htmlcov/
|
||||||
|
.env
|
||||||
# OS
|
.venv/
|
||||||
.DS_Store
|
venv/
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Docs
|
|
||||||
*.md
|
|
||||||
!README.md
|
|
||||||
|
|
||||||
# Local
|
|
||||||
*.log
|
*.log
|
||||||
*.tmp
|
.DS_Store
|
||||||
|
node_modules/
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Environment variables for Opus Orchestrator
|
||||||
|
|
||||||
|
# Required
|
||||||
|
MINIMAX_API_KEY=your_minimax_api_key_here
|
||||||
|
GITHUB_TOKEN=your_github_token_here
|
||||||
|
|
||||||
|
# Optional
|
||||||
|
LOG_LEVEL=INFO
|
||||||
|
API_HOST=0.0.0.0
|
||||||
|
API_PORT=8000
|
||||||
+16
-38
@@ -1,51 +1,29 @@
|
|||||||
# =============================================================================
|
# Opus Orchestrator API
|
||||||
# Opus Orchestrator AI - Dockerfile
|
# Dockerfile
|
||||||
# =============================================================================
|
|
||||||
# Build: docker build -t opus-orchestrator .
|
|
||||||
# Run: docker run -p 8080:8080 -p 8000:8000 -e OPENAI_API_KEY=sk-... opus-orchestrator
|
|
||||||
# =============================================================================
|
|
||||||
|
|
||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
# Labels
|
|
||||||
LABEL maintainer="mark@thefoldwithin.earth"
|
|
||||||
LABEL description="AI-powered book generation system"
|
|
||||||
LABEL version="0.2.0"
|
|
||||||
|
|
||||||
# Set working directory
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y \
|
||||||
build-essential \
|
git \
|
||||||
curl \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy project files
|
# Copy requirements first for caching
|
||||||
COPY pyproject.toml README.md install.sh ./
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy application
|
||||||
COPY opus_orchestrator/ ./opus_orchestrator/
|
COPY opus_orchestrator/ ./opus_orchestrator/
|
||||||
COPY config.example.yaml ./
|
COPY README.md .
|
||||||
|
|
||||||
# Create virtual environment
|
# Expose port
|
||||||
RUN python -m venv /opt/venv
|
EXPOSE 8000
|
||||||
ENV PATH="/opt/venv/bin:$PATH"
|
|
||||||
|
|
||||||
# Install Python dependencies
|
|
||||||
RUN pip install --no-cache-dir -e ".[all]"
|
|
||||||
|
|
||||||
# Create non-root user
|
|
||||||
RUN useradd -m -u 1000 opus && \
|
|
||||||
chown -R opus:opus /app
|
|
||||||
|
|
||||||
# Switch to non-root user
|
|
||||||
USER opus
|
|
||||||
|
|
||||||
# Expose ports
|
|
||||||
EXPOSE 8000 8080
|
|
||||||
|
|
||||||
# Health check
|
# Health check
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||||
CMD curl -f http://localhost:8000/health || exit 1
|
CMD curl -f http://localhost:8000/health || exit 1
|
||||||
|
|
||||||
# Default command: start web UI
|
# Run
|
||||||
CMD ["python", "-m", "opus_orchestrator", "ui", "--port", "8080"]
|
CMD ["python", "-m", "opus_orchestrator.server"]
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# Opus Orchestrator API
|
||||||
|
# Docker Compose for local development
|
||||||
|
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
opus-api:
|
||||||
|
image: opus-orchestrator:latest
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
environment:
|
||||||
|
- MINIMAX_API_KEY=${MINIMAX_API_KEY}
|
||||||
|
- GITHUB_TOKEN=${GITHUB_TOKEN}
|
||||||
|
- LOG_LEVEL=INFO
|
||||||
|
volumes:
|
||||||
|
- ./output:/app/output
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
|
texlive-api:
|
||||||
|
image: alex11br/texlive-api
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- texlive-cache:/root/.texlive
|
||||||
|
environment:
|
||||||
|
- TEXLIVE_ENGINE=xelatex
|
||||||
|
- MAX_TIMEOUT=180
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
texlive-cache:
|
||||||
Reference in New Issue
Block a user