[30388f42] Recovery & Stabilization: Restored productive core stack, implemented Docker Volumes for DB persistence, and fixed frontend build issues.

This commit is contained in:
2026-03-07 08:06:50 +00:00
parent 193b7b0e7d
commit efcaa57cf0
10 changed files with 610 additions and 225 deletions

View File

@@ -1,25 +1,42 @@
FROM python:3.11-slim
# --- STAGE 1: Builder ---
FROM python:3.11-slim AS builder
WORKDIR /app
# Install system dependencies
# Install system dependencies needed for building C-extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies
# Install dependencies system-wide
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# VERIFICATION STEP: Ensure uvicorn is installed and found
RUN which uvicorn || (echo "ERROR: uvicorn not found after install!" && exit 1)
# Copy source code
COPY . .
# --- STAGE 2: Final Runtime ---
FROM python:3.11-slim
WORKDIR /app
# Install curl for healthcheck
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Copy system-wide installed packages from builder
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
# Ensure /usr/local/bin (where pip installs executables by default) is in PATH
ENV PATH=/usr/local/bin:$PATH
# Copy source code explicitly from their locations relative to the build context (which will be the project root)
COPY worker.py .
COPY webhook_app.py .
COPY queue_manager.py .
COPY config.py .
COPY superoffice_client.py .
# Expose port for Webhook
EXPOSE 8000
# Make sure scripts are executable
RUN chmod +x start.sh
# Start both worker and webhook
CMD ["./start.sh"]
# Start both worker and webhook directly within the CMD, using absolute path for uvicorn
CMD ["/bin/bash", "-c", "python3 worker.py & /usr/local/bin/uvicorn webhook_app:app --host 0.0.0.0 --port 8000"]