Update Dockerfile
Browse files- Dockerfile +13 -18
Dockerfile
CHANGED
|
@@ -1,24 +1,19 @@
|
|
| 1 |
-
# Use a
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
| 11 |
-
# Copy the
|
| 12 |
-
COPY
|
|
|
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
COPY index.html /usr/share/nginx/html/index.html
|
| 16 |
-
|
| 17 |
-
# Change ownership of the web root directory
|
| 18 |
-
RUN chown -R nginx:nginx /usr/share/nginx/html
|
| 19 |
-
|
| 20 |
-
# Expose port 7860, as required by Hugging Face Spaces
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
-
# Command to run
|
| 24 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use a lightweight Python base image
|
| 2 |
+
FROM python:3.9-slim-buster
|
| 3 |
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the requirements file and install dependencies
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copy the Flask application and your HTML file
|
| 12 |
+
COPY app.py .
|
| 13 |
+
COPY index.html .
|
| 14 |
|
| 15 |
+
# Expose the port Flask will run on
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
EXPOSE 7860
|
| 17 |
|
| 18 |
+
# Command to run the Flask application
|
| 19 |
+
CMD ["python", "app.py"]
|