FROM python:3.9-slim WORKDIR /app # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install ffmpeg, wget, AND git RUN apt-get update && apt-get install -y bash ffmpeg wget git && apt-get clean # Set up user environment RUN mkdir -p /home/user && \ chown -R 1000:1000 /home/user ENV HOME="/home/user" # Create necessary directories RUN mkdir -p data/videos data/annotations data/temp data/word_timestamps data/alignments data/transcripts # Copy application code COPY . . # Add entrypoint script COPY entrypoint.sh /app/ RUN chmod +x /app/entrypoint.sh # Set proper permissions RUN chmod -R 755 /app && \ chmod -R 777 /app/data # Set environment variables ENV PYTHONUNBUFFERED=1 ENV PORT=7860 ENV SPACE_ID="true" ENV BYPASS_AUTH="true" ENV SECRET_KEY="f7290fc27f11dbf14be6cd348638ad62" ENV DEBUG="True" ENV S3_BUCKET="sorenson-ai-sb-scratch" ENV S3_VIDEO_PREFIX="awilkinson/kylie_dataset_videos_for_alignment_webapp/" ENV USE_S3_FOR_VIDEOS="true" # Make port available EXPOSE 7860 # Make sure the script exists and is executable RUN ls -la /app && \ ls -la /app/flask_app.py && \ which gunicorn && \ pip list # Use entrypoint script CMD ["bash", "/app/entrypoint.sh"]