srivatsavdamaraju
commited on
Update Dockerfile
Browse files- Dockerfile +16 -12
Dockerfile
CHANGED
@@ -1,20 +1,24 @@
|
|
1 |
-
# Use
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
-
# Set
|
5 |
-
ENV PYTHONUNBUFFERED 1
|
6 |
-
|
7 |
-
# Set the working directory inside the container
|
8 |
WORKDIR /app
|
9 |
|
10 |
-
#
|
11 |
-
COPY .
|
12 |
|
13 |
-
# Install any needed dependencies
|
14 |
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
-
#
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
# Command to run the Flask app
|
20 |
-
CMD ["
|
|
|
1 |
+
# Use the official Python base image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set a working directory
|
|
|
|
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install dependencies
|
8 |
+
COPY requirements.txt .
|
9 |
|
|
|
10 |
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
|
12 |
+
# Copy the Flask application to the container
|
13 |
+
COPY . .
|
14 |
+
|
15 |
+
# Expose the port that the app will run on (Hugging Face Spaces typically uses port 7860)
|
16 |
+
EXPOSE 7860
|
17 |
+
|
18 |
+
# Set environment variables for Flask and Gunicorn
|
19 |
+
ENV FLASK_APP=app.py
|
20 |
+
ENV FLASK_RUN_HOST=0.0.0.0
|
21 |
+
ENV FLASK_RUN_PORT=7860
|
22 |
|
23 |
+
# Command to run the Flask app with gunicorn
|
24 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|