RANA
commited on
Commit
•
adad52a
1
Parent(s):
07cb691
wsgi
Browse files- Dockerfile +5 -2
- app.py +1 -5
- wsgi.py +4 -0
Dockerfile
CHANGED
@@ -1,15 +1,18 @@
|
|
1 |
FROM python:3.9
|
2 |
|
|
|
|
|
3 |
COPY requirements.txt .
|
4 |
|
5 |
RUN pip install -r requirements.txt
|
6 |
|
7 |
RUN apt-get update && apt-get install -y libgl1-mesa-glx
|
8 |
|
9 |
-
|
|
|
10 |
|
11 |
COPY . .
|
12 |
|
13 |
EXPOSE 7860
|
14 |
|
15 |
-
CMD ["
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
WORKDIR /ARAZIM
|
4 |
+
|
5 |
COPY requirements.txt .
|
6 |
|
7 |
RUN pip install -r requirements.txt
|
8 |
|
9 |
RUN apt-get update && apt-get install -y libgl1-mesa-glx
|
10 |
|
11 |
+
# Install Gunicorn
|
12 |
+
RUN pip install gunicorn
|
13 |
|
14 |
COPY . .
|
15 |
|
16 |
EXPOSE 7860
|
17 |
|
18 |
+
CMD ["gunicorn", "wsgi:app", "--bind", "0.0.0.0:7860"]
|
app.py
CHANGED
@@ -342,11 +342,7 @@ if __name__ == "__main__":
|
|
342 |
with app.app_context():
|
343 |
# Check the database connection before running the application
|
344 |
if test_db_connection():
|
345 |
-
|
346 |
-
print("Connection Successfull")
|
347 |
-
print("Connection Successfull")
|
348 |
-
print("Connection Successfull")
|
349 |
-
app.run(debug=True)
|
350 |
else:
|
351 |
print("Database connection failed.")
|
352 |
except Exception as e:
|
|
|
342 |
with app.app_context():
|
343 |
# Check the database connection before running the application
|
344 |
if test_db_connection():
|
345 |
+
app.run()
|
|
|
|
|
|
|
|
|
346 |
else:
|
347 |
print("Database connection failed.")
|
348 |
except Exception as e:
|
wsgi.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from app import app
|
2 |
+
|
3 |
+
if __name__ == "__main__":
|
4 |
+
app.run()
|