Files
opro_demo/Dockerfile.allinone
leehwui 26f8e0c648 feat: add Docker support for offline deployment with qwen3:14b
Major additions:
- All-in-One Docker image with Ollama + models bundled
- Separate deployment option for existing Ollama installations
- Changed default model from qwen3:8b to qwen3:14b
- Comprehensive deployment documentation

Files added:
- Dockerfile: Basic app-only image
- Dockerfile.allinone: Complete image with Ollama + models
- docker-compose.yml: Easy deployment configuration
- docker-entrypoint.sh: Startup script for all-in-one image
- requirements.txt: Python dependencies
- .dockerignore: Exclude unnecessary files from image

Scripts:
- export-ollama-models.sh: Export models from local Ollama
- build-allinone.sh: Build complete offline-deployable image
- build-and-export.sh: Build and export basic image

Documentation:
- DEPLOYMENT.md: Comprehensive deployment guide
- QUICK_START.md: Quick reference for common tasks

Configuration:
- Updated config.py: DEFAULT_CHAT_MODEL = qwen3:14b
- Updated frontend/opro.html: Page title to 系统提示词优化
2025-12-08 10:10:38 +08:00

51 lines
1.2 KiB
Docker

FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies including curl for Ollama
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh
# Copy requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY _qwen_xinference_demo/ ./_qwen_xinference_demo/
COPY frontend/ ./frontend/
COPY config.py .
# Create necessary directories
RUN mkdir -p outputs /root/.ollama
# Copy pre-downloaded Ollama models
# This includes qwen3:14b and qwen3-embedding:4b
COPY ollama-models/ /root/.ollama/
# Expose ports
EXPOSE 8010 11434
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV OLLAMA_HOST=http://localhost:11434
# Copy startup script
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8010/health && curl -f http://localhost:11434/api/tags || exit 1
# Run the startup script
ENTRYPOINT ["/docker-entrypoint.sh"]