Spaces:
Sleeping
Sleeping
# Use an official Python slim image for the base | |
FROM python:3.10-slim | |
# Set the working directory | |
WORKDIR /app | |
# Install dependencies: wget, gnupg2, and unzip | |
RUN apt-get update && apt-get install -y \ | |
wget \ | |
gnupg2 \ | |
apt-transport-https \ | |
&& wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ | |
&& dpkg -i packages-microsoft-prod.deb \ | |
&& apt-get update \ | |
&& apt-get install -y dotnet-sdk-7.0 \ | |
&& rm packages-microsoft-prod.deb \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set the .NET environment variables | |
ENV DOTNET_ROOT=/usr/share/dotnet | |
ENV PATH=$PATH:/usr/share/dotnet:/usr/share/dotnet/sdk/7.0.100 | |
# Check if 'dotnet --info' works and also check for 'csc' | |
RUN dotnet --info && ls /usr/share/dotnet/sdk/7.0.100 && echo $PATH && which csc | |
# Install Python pip and other dependencies | |
RUN apt-get install -y python3-pip && pip3 install --no-cache-dir --upgrade -r /app/requirements.txt | |
# Create necessary directories and set permissions | |
RUN mkdir -p /app/uploads && chmod -R 777 /app/uploads | |
# Copy the Flask app files | |
COPY . . | |
# Expose the port the app runs on | |
EXPOSE 7860 | |
# Command to run the Flask app | |
CMD ["python3", "main.py"] | |