sigyllly commited on
Commit
54215af
·
verified ·
1 Parent(s): 700c673

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -23
Dockerfile CHANGED
@@ -1,34 +1,30 @@
1
  # Use an official Python slim image for the base
2
  FROM python:3.10-slim
3
 
4
- # Use the .NET 6 SDK image
5
- FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
6
-
7
  # Set the working directory
8
  WORKDIR /app
9
 
10
- # Install necessary dependencies
11
- RUN apt-get update && apt-get install -y wget
12
-
13
- # Copy project files
14
- COPY . ./
 
 
 
 
15
 
16
- # Install Python dependencies (if needed)
17
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
18
-
19
- # Expose the port Flask runs on
20
- EXPOSE 7860
21
 
22
- # Build and publish the C# project
23
- RUN dotnet publish -c Release -o out
24
 
25
- # Use a runtime image for the published output
26
- FROM mcr.microsoft.com/dotnet/aspnet:6.0
27
 
28
- WORKDIR /app
29
-
30
- # Copy the published output from the build stage
31
- COPY --from=build-env /app/out .
32
 
33
- # Command to run the Flask app (Python and .NET can run simultaneously)
34
- CMD ["python", "main.py"]
 
1
  # Use an official Python slim image for the base
2
  FROM python:3.10-slim
3
 
 
 
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Install dependencies: .NET SDK, wget, and Python pip
8
+ RUN apt-get update && apt-get install -y \
9
+ wget \
10
+ apt-transport-https \
11
+ && wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
12
+ && dpkg -i packages-microsoft-prod.deb \
13
+ && apt-get update && apt-get install -y dotnet-sdk-7.0 \
14
+ && apt-get install -y python3-pip \
15
+ && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Copy the requirements file
18
+ COPY ./requirements.txt /app/requirements.txt
 
 
 
19
 
20
+ # Install Python dependencies
21
+ RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
22
 
23
+ # Copy the Flask app files
24
+ COPY . .
25
 
26
+ # Expose the port the app runs on
27
+ EXPOSE 7860
 
 
28
 
29
+ # Command to run the Flask app
30
+ CMD ["python3", "main.py"]