diff --git a/Dockerfile b/Dockerfile index c417faf1a..61bce9027 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,13 @@ FROM ubuntu:20.04 -COPY supervisord.conf /etc/supervisord.conf +RUN apt update && apt install -y python3.8 python3-pip -RUN apt update && apt install -y python3.8 python3-pip supervisor +COPY requirements.txt /service/requirements.txt -RUN mkdir -p ./service +WORKDIR /service -COPY requirements.txt ./service/requirements.txt - -RUN cd ./service && pip3 install -r requirements.txt +RUN pip3 install -r requirements.txt EXPOSE 80/tcp -CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ] +CMD gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --max-requests 1000 --max-requests-jitter 500 \ No newline at end of file diff --git a/files/__main__.py b/files/__main__.py index 4f203654d..a8aa98fe3 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -100,10 +100,6 @@ def before_request(): g.timestamp = int(time.time()) - if request.url.startswith("http://") and "localhost" not in app.config["SERVER_NAME"]: - url = request.url.replace("http://", "https://", 1) - return redirect(url, code=301) - if '; wv) ' in request.headers.get("User-Agent",""): g.webview = True else: g.webview = False