- Update docker-start.sh to force correct profiles (qdrant, admin) - Fix PostgreSQL port mapping from 5432 to 15432 across all configs - Resolve MCP import conflicts by renaming src/mcp to src/mcp_servers - Fix admin interface StaticFiles mount syntax error - Update LLM client to support both Ollama and OpenAI-compatible APIs - Configure host networking for Discord bot container access - Correct database connection handling for async context managers - Update environment variables and Docker compose configurations - Add missing production dependencies and Dockerfile improvements
56 lines
1.5 KiB
Docker
56 lines
1.5 KiB
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
gcc \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Node.js for frontend build
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
|
&& apt-get install -y nodejs
|
|
|
|
# Copy requirements first for better caching
|
|
COPY requirements-admin.txt .
|
|
RUN pip install --no-cache-dir -r requirements-admin.txt
|
|
|
|
# Install additional dependencies needed for production
|
|
RUN pip install --no-cache-dir asyncpg python-dotenv
|
|
|
|
# Copy application code
|
|
COPY src/ ./src/
|
|
COPY config/ ./config/
|
|
COPY migrations/ ./migrations/
|
|
COPY alembic.ini ./
|
|
|
|
# Build frontend
|
|
COPY admin-frontend/ ./admin-frontend/
|
|
WORKDIR /app/admin-frontend
|
|
|
|
# Clear any existing node_modules and lock files
|
|
RUN rm -rf node_modules package-lock.json yarn.lock
|
|
|
|
# Install dependencies with npm (using .npmrc config)
|
|
RUN npm install
|
|
|
|
# Build with increased memory for Node.js
|
|
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
# Try building with fallback to a simple static file
|
|
RUN npm run build || (echo "Build failed, creating minimal static files" && mkdir -p build && echo '<html><body><h1>Admin Interface Build Failed</h1><p>Please check the build configuration.</p></body></html>' > build/index.html)
|
|
|
|
# Back to main directory
|
|
WORKDIR /app
|
|
|
|
# Create logs directory
|
|
RUN mkdir -p logs
|
|
|
|
# Set Python path
|
|
ENV PYTHONPATH=/app/src
|
|
|
|
# Expose admin port
|
|
EXPOSE 8000
|
|
|
|
# Run the admin interface
|
|
CMD ["python", "-m", "src.admin.app"] |