luis-blash
commited on
Commit
•
e249f95
1
Parent(s):
cc048d3
feat: app.py and docker
Browse files- Dockerfile +14 -0
- app.py +14 -0
- requirements.txt +2 -0
Dockerfile
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
+
|
6 |
+
WORKDIR /app
|
7 |
+
|
8 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
9 |
+
|
10 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
11 |
+
|
12 |
+
COPY --chown=user . /app
|
13 |
+
|
14 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860","app:app"]
|
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, jsonify
|
2 |
+
|
3 |
+
app = Flask(__name__)
|
4 |
+
|
5 |
+
@app.route('/')
|
6 |
+
def hello_world():
|
7 |
+
data = {
|
8 |
+
'message': '¡Hola, mundo!',
|
9 |
+
'status': 'success'
|
10 |
+
}
|
11 |
+
return jsonify(data)
|
12 |
+
|
13 |
+
if __name__ == '__main__':
|
14 |
+
app.run(debug=True)
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
flask
|
2 |
+
gunicorn
|