Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install ffmpeg and other dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| ffmpeg \ | |
| build-essential \ | |
| nodejs \ | |
| npm \ | |
| git \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create directories for temp files | |
| RUN mkdir -p temp_audio temp static | |
| # Copy the application code | |
| COPY . . | |
| # List directory contents | |
| RUN ls -la | |
| # Execute the build frontend script to prepare frontend code | |
| RUN chmod +x build_frontend.sh && \ | |
| ./build_frontend.sh && \ | |
| echo "Frontend build script completed successfully" | |
| # Verify the static files | |
| RUN echo "Checking static directory contents:" && \ | |
| ls -la ./static && \ | |
| if [ -f "./static/index.html" ]; then \ | |
| echo "Frontend index.html found"; \ | |
| else \ | |
| echo "WARNING: Frontend index.html not found in static directory"; \ | |
| exit 1; \ | |
| fi && \ | |
| if [ -d "./static/assets" ]; then \ | |
| echo "Frontend assets directory found"; \ | |
| ls -la ./static/assets; \ | |
| else \ | |
| echo "WARNING: Frontend assets directory not found"; \ | |
| fi | |
| # Install backend dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Default environment variables | |
| ENV PORT=7860 | |
| ENV HOST=0.0.0.0 | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Command to run the application | |
| CMD ["python", "app.py"] |