Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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
|
11 |
-
RUN apt-get update && apt-get install -y
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
-
|
19 |
-
# Expose the port Flask runs on
|
20 |
-
EXPOSE 7860
|
21 |
|
22 |
-
#
|
23 |
-
RUN
|
24 |
|
25 |
-
#
|
26 |
-
|
27 |
|
28 |
-
|
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
|
34 |
-
CMD ["
|
|
|
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"]
|