upload
Browse files- Dockerfile +14 -8
- app.py +7 -7
- requirements.txt +1 -2
Dockerfile
CHANGED
@@ -1,14 +1,20 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
|
|
|
7 |
|
8 |
-
|
|
|
9 |
|
10 |
-
|
|
|
11 |
|
12 |
-
|
|
|
13 |
|
14 |
-
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set the working directory to /app
|
5 |
+
WORKDIR /app
|
6 |
|
7 |
+
# Copy the requirements file into the container
|
8 |
+
COPY requirements.txt .
|
9 |
|
10 |
+
# Install any needed packages specified in requirements.txt
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
+
# Copy the current directory contents into the container at /app
|
14 |
+
COPY . /app
|
15 |
|
16 |
+
# Expose port 7860 for the Flask app to listen on
|
17 |
+
EXPOSE 7860
|
18 |
|
19 |
+
# Run the command to start the Flask app
|
20 |
+
CMD ["python", "app.py"]
|
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
from
|
2 |
|
3 |
-
app =
|
4 |
|
5 |
-
@app.
|
6 |
-
def
|
7 |
-
return
|
8 |
|
9 |
-
|
10 |
-
|
|
|
1 |
+
from flask import Flask
|
2 |
|
3 |
+
app = Flask(__name__)
|
4 |
|
5 |
+
@app.route('/')
|
6 |
+
def hello_world():
|
7 |
+
return 'Hello, World!'
|
8 |
|
9 |
+
if __name__ == '__main__':
|
10 |
+
app.run(debug=True, host='0.0.0.0', port=7860)
|
requirements.txt
CHANGED
@@ -1,2 +1 @@
|
|
1 |
-
|
2 |
-
fastapi==0.65.2
|
|
|
1 |
+
flask
|
|