Spaces:
Sleeping
Sleeping
Commit
·
53f427c
1
Parent(s):
cc4a190
Update Dockerfile
Browse files- Dockerfile +30 -10
Dockerfile
CHANGED
|
@@ -1,18 +1,38 @@
|
|
| 1 |
-
# Use an official Python image
|
| 2 |
-
FROM python:3.10
|
| 3 |
|
| 4 |
-
# Set working directory inside the container
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy
|
| 8 |
-
COPY .
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
RUN pip install -r requirements.txt
|
| 13 |
|
| 14 |
-
# Expose the
|
| 15 |
EXPOSE 5000
|
| 16 |
|
| 17 |
-
#
|
| 18 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# # Use an official Python image
|
| 2 |
+
# FROM python:3.10
|
| 3 |
|
| 4 |
+
# # Set working directory inside the container
|
| 5 |
+
# WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# # Copy all files into the container
|
| 8 |
+
# COPY . /app
|
| 9 |
+
|
| 10 |
+
# # Install dependencies
|
| 11 |
+
# RUN pip install --upgrade pip
|
| 12 |
+
# RUN pip install -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# # Expose the default port
|
| 15 |
+
# EXPOSE 5000
|
| 16 |
+
|
| 17 |
+
# # Run the Flask app
|
| 18 |
+
# CMD ["python", "app.py"]
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
# Use a lightweight Python image
|
| 22 |
+
FROM python:3.9-slim
|
| 23 |
+
|
| 24 |
+
# Set working directory
|
| 25 |
WORKDIR /app
|
| 26 |
|
| 27 |
+
# Copy requirements and install them
|
| 28 |
+
COPY requirements.txt .
|
| 29 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 30 |
|
| 31 |
+
# Copy app code
|
| 32 |
+
COPY . .
|
|
|
|
| 33 |
|
| 34 |
+
# Expose the port used by Flask
|
| 35 |
EXPOSE 5000
|
| 36 |
|
| 37 |
+
# Start the Flask app
|
| 38 |
CMD ["python", "app.py"]
|