change wsgi server
Marco Andronaco andronacomarco@gmail.com
Thu, 10 Aug 2023 01:04:35 +0200
4 files changed,
11 insertions(+),
17 deletions(-)
M
Dockerfile
→
Dockerfile
@@ -1,11 +1,11 @@
-FROM python:3-alpine - -COPY main.py . -COPY requirements.txt . -COPY tntvillage-release-dump ./tntvillage-release-dump -COPY templates ./templates +FROM tiangolo/meinheld-gunicorn-flask:python3.9-alpine3.13 RUN pip install --upgrade pip +COPY requirements.txt . RUN pip install -r requirements.txt -CMD ["waitress-serve", "--host", "0.0.0.0", "--port", "5000", "main:app"] +COPY main.py /app/main.py +COPY tntvillage-release-dump /app/tntvillage-release-dump +COPY templates /app/templates + +ENV APP_MODULE=main:app
M
docker-compose.yaml
→
docker-compose.yaml
@@ -3,11 +3,6 @@ tnt-search:
image: tnt-search:latest build: . container_name: tnt-search - #ports: - # - "5000:5000" # Uncomment if you don't use a reverse proxy + ports: + - "127.0.0.1:1111:80" # Uncomment if you don't use a reverse proxy restart: unless-stopped - networks: - - swag_default -networks: - swag_default: - external: true
M
main.py
→
main.py
@@ -96,14 +96,14 @@ app = Flask(__name__)
@app.route('/api/header') def route_api_header(): - return json.dumps(HEADER) + return HEADER @app.route('/api') def route_api(): keywords, category, page = get_args(request.args) results = search_keyword(content, keywords, int(category)) results = get_last_torrents(results, page=int(page)) - return json.dumps(results) + return results @app.route('/') def route_main():
M
requirements.txt
→
requirements.txt
@@ -4,5 +4,4 @@ Flask==2.3.2
itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.3 -waitress==2.1.2 Werkzeug==2.3.6