Spaces:
Running
Running
File size: 995 Bytes
24f95f0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | FROM python:3.11-slim
WORKDIR /app/backend
# Install only essential system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install playwright browsers if possible, but don't fail if it doesn't work
RUN playwright install --with-deps chromium 2>/dev/null || echo "Playwright installation failed, continuing..."
# Copy the application code
COPY . .
# Create necessary directories
RUN mkdir -p /app/backend/app/data/context /app/backend/app/data/daemon /app/backend/app/data/adaptive /app/backend/app/data/knowledge /app/backend/app/data/memory /app/backend/app/data/simulations
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
# Expose port and run the application
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|