Add Docker Compose and Dockerfile
This commit is contained in:
+13
-32
@@ -1,40 +1,21 @@
|
||||
# Git
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
# Python
|
||||
__pycache__
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyd
|
||||
.Python
|
||||
venv/
|
||||
.venv/
|
||||
env/
|
||||
.env
|
||||
*.so
|
||||
*.egg
|
||||
*.egg-info/
|
||||
dist/
|
||||
build/
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Testing
|
||||
.git/
|
||||
.gitignore
|
||||
.pytest_cache/
|
||||
.coverage
|
||||
htmlcov/
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Docs
|
||||
*.md
|
||||
!README.md
|
||||
|
||||
# Local
|
||||
.env
|
||||
.venv/
|
||||
venv/
|
||||
*.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 AI - Dockerfile
|
||||
# =============================================================================
|
||||
# Build: docker build -t opus-orchestrator .
|
||||
# Run: docker run -p 8080:8080 -p 8000:8000 -e OPENAI_API_KEY=sk-... opus-orchestrator
|
||||
# =============================================================================
|
||||
# Opus Orchestrator API
|
||||
# Dockerfile
|
||||
|
||||
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
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
curl \
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy project files
|
||||
COPY pyproject.toml README.md install.sh ./
|
||||
# Copy requirements first for caching
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application
|
||||
COPY opus_orchestrator/ ./opus_orchestrator/
|
||||
COPY config.example.yaml ./
|
||||
COPY README.md .
|
||||
|
||||
# Create virtual environment
|
||||
RUN python -m venv /opt/venv
|
||||
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
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:8000/health || exit 1
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD curl -f http://localhost:8000/health || exit 1
|
||||
|
||||
# Default command: start web UI
|
||||
CMD ["python", "-m", "opus_orchestrator", "ui", "--port", "8080"]
|
||||
# Run
|
||||
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