Spaces:
Sleeping
Sleeping
| # Use Python 3.9 as the base image | |
| FROM python:3.9 | |
| # Install FFmpeg | |
| RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Set up environment variables | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy and install dependencies | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy application files | |
| COPY --chown=user . /app | |
| # Expose the required port | |
| EXPOSE 7860 | |
| # Run the service | |
| CMD ["python3", "start_service.py", "--port", "7860", "--tmp-dir", "/tmp/encoder_main"] | |