Spaces:
Sleeping
Sleeping
# Use an official Python slim image for the base | |
FROM python:3.10-slim | |
# Install Wine and dependencies for running Windows applications | |
RUN dpkg --add-architecture i386 && \ | |
apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
wine64 \ | |
wine32 \ | |
wget \ | |
apt-utils && \ | |
apt-get clean | |
# Create directories and set permissions | |
WORKDIR /app | |
RUN mkdir -p /app/uploads /app/compiled && chmod -R 777 /app/uploads /app/compiled | |
# Download and install the .NET Framework redistributable that includes csc.exe | |
# Replace this link with the correct version you need for csc 4.8 | |
RUN wget https://download.microsoft.com/download/1/2/7/127FAFB4-1D34-4997-8E96-3E9892936C58/ndp48-x86-x64-allos-enu.exe -O dotnet-installer.exe | |
# Use Wine to run the installer | |
RUN wine dotnet-installer.exe /quiet /norestart | |
# Verify if csc.exe is installed and accessible | |
RUN wine64 "C:/Windows/Microsoft.NET/Framework64/v4.0.30319/csc.exe" /help || echo "CSC is installed" | |
# Copy the requirements file and install Python dependencies | |
COPY requirements.txt . | |
RUN pip install -r requirements.txt | |
# Copy the Flask app files | |
COPY . . | |
# Expose the Flask app port | |
EXPOSE 7860 | |
# Run the Flask application | |
CMD ["python", "main.py"] | |