39 lines
868 B
Docker
39 lines
868 B
Docker
|
|
FROM python:3.10-slim
|
||
|
|
|
||
|
|
# Set working directory
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Install system dependencies
|
||
|
|
RUN apt-get update && apt-get install -y \
|
||
|
|
curl \
|
||
|
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
|
||
|
|
# 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 outputs directory
|
||
|
|
RUN mkdir -p outputs
|
||
|
|
|
||
|
|
# Expose port
|
||
|
|
EXPOSE 8010
|
||
|
|
|
||
|
|
# Set environment variables
|
||
|
|
ENV PYTHONUNBUFFERED=1
|
||
|
|
ENV OLLAMA_HOST=http://host.docker.internal:11434
|
||
|
|
|
||
|
|
# Health check
|
||
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||
|
|
CMD curl -f http://localhost:8010/health || exit 1
|
||
|
|
|
||
|
|
# Run the application
|
||
|
|
CMD ["uvicorn", "_qwen_xinference_demo.api:app", "--host", "0.0.0.0", "--port", "8010"]
|
||
|
|
|