Spaces:
Sleeping
Sleeping
Bouaziz-bad commited on
Commit ·
1bf0075
1
Parent(s): 00c3321
Initial commit of Dockerfile
Browse files- Dockerfile +14 -0
- app.py +11 -0
Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a minimal Python image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Install the web server and application framework
|
| 5 |
+
RUN pip install gunicorn Flask
|
| 6 |
+
|
| 7 |
+
# Copy the application code
|
| 8 |
+
COPY app.py .
|
| 9 |
+
|
| 10 |
+
# Expose the port
|
| 11 |
+
EXPOSE 8000
|
| 12 |
+
|
| 13 |
+
# Start the application
|
| 14 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app"]
|
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from flask import Flask
|
| 2 |
+
|
| 3 |
+
app = Flask(__name__)
|
| 4 |
+
|
| 5 |
+
@app.route("/")
|
| 6 |
+
def hello_world():
|
| 7 |
+
return "Hello from the test backend!"
|
| 8 |
+
|
| 9 |
+
@app.route("/health")
|
| 10 |
+
def health_check():
|
| 11 |
+
return "Healthy", 200
|