From 2e343a3ea5cbb3fd0dd4c5f9da1e042179b37509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 11:47:39 +0100 Subject: [PATCH] fix server related stuff --- Dockerfile | 4 ++-- app.py | 9 ++++----- requirements.txt | 3 ++- static/index.html | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7c2fb1..1421080 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ WORKDIR /app COPY . . RUN pip install --no-cache-dir -r requirements.txt -EXPOSE 5000 +EXPOSE 8000 -CMD ["python", "app.py"] +CMD ["python", "-m", "gunicorn", "app:app"] diff --git a/app.py b/app.py index 2454536..ea16a6c 100644 --- a/app.py +++ b/app.py @@ -1,18 +1,17 @@ from flask import Flask, send_from_directory -import os app = Flask(__name__, static_folder='static', static_url_path='/static') + @app.route('/') def index(): return send_from_directory('static', 'index.html') -# Serve static files + @app.route('/') def static_files(filename): return send_from_directory('static', filename) + if __name__ == '__main__': - import sys - port = int(sys.argv[1]) if len(sys.argv) > 1 else 5000 - app.run(debug=True, host='0.0.0.0', port=port) + app.run(debug=True, host='0.0.0.0', port=5000) diff --git a/requirements.txt b/requirements.txt index 5eaf725..f941d23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ flask -requests \ No newline at end of file +gunicorn +requests diff --git a/static/index.html b/static/index.html index 4a9f90c..804f268 100644 --- a/static/index.html +++ b/static/index.html @@ -4,7 +4,7 @@ OpenAI Models Viewer - +
@@ -91,6 +91,6 @@
- + - \ No newline at end of file +