Spaces:
Running
Running
Dockerfile
Browse files- Dockerfile +23 -0
- src/app.py +1 -1
Dockerfile
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Python image from the Docker Hub
|
2 |
+
FROM python:3.11-slim
|
3 |
+
|
4 |
+
# Set the working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the requirements file into the image
|
8 |
+
COPY requirements.txt .
|
9 |
+
|
10 |
+
# Install the dependencies
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
# Copy the rest of the application code into the image
|
14 |
+
COPY . .
|
15 |
+
|
16 |
+
# Expose the port the app runs on
|
17 |
+
EXPOSE 7860
|
18 |
+
|
19 |
+
# Set the environment variable for Flask
|
20 |
+
ENV FLASK_APP=app
|
21 |
+
|
22 |
+
# Command to run the Flask app
|
23 |
+
CMD ["python", "src/app.py"]
|
src/app.py
CHANGED
@@ -52,4 +52,4 @@ def process_document_route():
|
|
52 |
|
53 |
# Run the Flask app
|
54 |
if __name__ == "__main__":
|
55 |
-
app.run(debug=True, port=
|
|
|
52 |
|
53 |
# Run the Flask app
|
54 |
if __name__ == "__main__":
|
55 |
+
app.run(debug=True, port=7860, host='0.0.0.0')
|