Spaces:
Runtime error
Runtime error
File size: 892 Bytes
2d126ba 419f982 2d126ba 7b25dd3 2d126ba a53cb38 bb3c951 8a9ebcc a53cb38 d919708 2d126ba 0487d89 8a9ebcc a835204 19abece 2d126ba 7b25dd3 2d126ba 1b86d8a 2d126ba d919708 fbbbd2c 2d126ba fbbbd2c 419f982 8a9ebcc 5e6c2a1 8a9ebcc 2d126ba 7b25dd3 ab0aad3 2d126ba efa9887 | 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
chromium-driver \
git \
gcc \
libc-dev \
ffmpeg \
sqlite3 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Update pip
RUN pip install --upgrade pip
# Install torch and dependencies
RUN pip install packaging torch==2.4.1
# Copy requirements.txt and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create /data directory with correct permissions
RUN mkdir -p /data && chmod -R 755 /data
# Copy all project files
COPY . .
# Verify files in /app
RUN ls -R /app
# Initialize the database
ENV SQLALCHEMY_DATABASE_URL=sqlite+aiosqlite:///./data/mgzon_users.db
RUN python init_db.py
# Expose port 7860 for FastAPI
EXPOSE 7860
# Run the FastAPI app
CMD ["python", "main.py"]
|