Spaces:
Runtime error
Runtime error
Tarandeep Singh commited on
Commit ·
88ba9f0
1
Parent(s): 5d568e5
gunicorn server
Browse files- Dockerfile +3 -4
- app.py +4 -1
- requirements.txt +1 -0
Dockerfile
CHANGED
|
@@ -10,8 +10,7 @@ COPY ./requirements.txt /code/requirements.txt
|
|
| 10 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 11 |
|
| 12 |
COPY . .
|
| 13 |
-
|
| 14 |
-
EXPOSE 5000
|
| 15 |
|
| 16 |
-
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "5000"]
|
| 17 |
-
#CMD [ "python3","app.py"]
|
|
|
|
|
|
| 10 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 11 |
|
| 12 |
COPY . .
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
#CMD ["flask", "run", "--host", "0.0.0.0", "--port", "5000"]
|
| 15 |
+
#CMD [ "python3","app.py"]
|
| 16 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
app.py
CHANGED
|
@@ -32,5 +32,8 @@ def generate_sequence():
|
|
| 32 |
#return render_template('result.html', sequence=output_sequence)
|
| 33 |
return jsonify({'sequence': output_sequence})
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
app.run(debug=True, port = int(os.getenv("PORT")))
|
|
|
|
|
|
| 32 |
#return render_template('result.html', sequence=output_sequence)
|
| 33 |
return jsonify({'sequence': output_sequence})
|
| 34 |
|
| 35 |
+
'''
|
| 36 |
+
#note needed for gunicorn server
|
| 37 |
+
# if __name__ == '__main__':
|
| 38 |
app.run(debug=True, port = int(os.getenv("PORT")))
|
| 39 |
+
'''
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
Flask==2.2.5
|
| 2 |
nltk==3.7
|
| 3 |
pandas==1.2.4
|
|
|
|
|
|
| 1 |
Flask==2.2.5
|
| 2 |
nltk==3.7
|
| 3 |
pandas==1.2.4
|
| 4 |
+
gunicorn
|