File size: 1,296 Bytes
700c673
 
 
14cd36c
7dfb4c7
c0bbedf
54215af
 
 
 
 
 
 
7ca2966
54215af
d3a4ebc
80daa1b
 
 
54215af
 
c0bbedf
54215af
 
a07f417
54215af
 
14cd36c
54215af
 
66f8fc1
8412d29
 
 
 
 
 
63be5ca
 
8412d29
63be5ca
9562d52
54215af
 
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
# Use an official Python slim image for the base
FROM python:3.10-slim

# Set the working directory
WORKDIR /app

# Install dependencies: .NET SDK, wget, and Python pip
RUN apt-get update && apt-get install -y \
    wget \
    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 \
    python3-pip \
    && rm -rf /var/lib/apt/lists/*

# Create uploads directory and set permissions
RUN mkdir -p /app/uploads && chmod -R 777 /app/uploads

# Copy the requirements file
COPY ./requirements.txt /app/requirements.txt

# Install Python dependencies
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt

# Copy the Flask app files
COPY . .

# Expose the port the app runs on
EXPOSE 7860

# Check for dotnet instead of csc
RUN DOTNET_PATH=$(find / -name dotnet 2>/dev/null | head -n 1) && \
    if [ -n "$DOTNET_PATH" ]; then \
    DOTNET_DIR=$(dirname $DOTNET_PATH); \
    echo "Found dotnet at: $DOTNET_PATH"; \
    export PATH=$DOTNET_DIR:$PATH; \
    echo "Updated PATH: $PATH"; \
    else \
    echo "dotnet not found!"; \
    fi

# Command to run the Flask app
CMD ["python3", "main.py"]