File size: 1,238 Bytes
d3a4ebc
bd9ffae
66f8fc1
7dfb4c7
 
1de3b07
7dfb4c7
 
 
 
 
 
 
d3a4ebc
7dfb4c7
c0bbedf
 
d3a4ebc
 
 
 
 
 
 
 
 
 
 
7dfb4c7
 
c0bbedf
d3a4ebc
bd9ffae
a07f417
7dfb4c7
9c0cec7
66f8fc1
7dfb4c7
9785135
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
# 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"]