Spaces:
Running
Running
File size: 1,494 Bytes
3f6620b 5d6bc93 f7cadd1 b1c83cf f7cadd1 0a4c004 7b26877 090922d 887263b eab0955 7b26877 eab0955 7b26877 5d6bc93 7b26877 5d6bc93 7b26877 5d6bc93 7b26877 fcbfe3c 5d6bc93 7b26877 5d6bc93 7b26877 489485e 14b19fa 5d6bc93 7b26877 1f8103f |
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 47 48 |
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"] |