Spaces:
Paused
Paused
| FROM debian:stable | |
| USER root | |
| ENV DEBIAN_FRONTEND noninteractive | |
| # Update package lists | |
| RUN apt-get update | |
| RUN apt install -y gnupg curl wget | |
| # Add .NET repository key | |
| RUN curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
| # Add .NET repository to sources list | |
| RUN echo "deb [arch=amd64] https://packages.microsoft.com/debian/11/prod bullseye main" >> /etc/apt/sources.list.d/microsoft-prod.list | |
| RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb -O libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb \ | |
| && dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb | |
| RUN apt-get update | |
| # Install .NET Runtime | |
| RUN apt-get install -y aspnetcore-runtime-5.0 | |
| # Install Python 3 | |
| RUN apt-get update && apt-get install -y python3 | |
| # Install pip | |
| RUN apt-get update && apt-get install -y python3-pip | |
| # Install venv | |
| RUN apt-get update && apt-get install -y python3-venv | |
| # Copy application files | |
| COPY . /app | |
| RUN chmod -R 777 /app | |
| # Create and activate virtual environment | |
| WORKDIR /app | |
| RUN python3 -m venv /app/venv | |
| RUN /app/venv/bin/pip install -U pip | |
| RUN /app/venv/bin/pip install watchdog uvicorn fastapi | |
| # Set environment variables | |
| RUN DOTNET_ROOT=$(dirname $(readlink $(command -v dotnet))) && \ | |
| export DOTNET_ROOT && \ | |
| export PATH="/app/venv/bin:/app/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$DOTNET_ROOT" | |
| # Run the application | |
| CMD ["/app/venv/bin/python", "/app/stream_videos.py"] |