diff --git a/Dockerfile b/Dockerfile index 4d4ec75560d28a0f2f02ee606da544b5f1adcd5f..8add38921dba7fcd6ae35b702df7c45d94ca80b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,14 @@ EXPOSE 5000 WORKDIR /usr/src/app +RUN apk add --update alpine-sdk && \ +apk add libffi-dev openssl-dev && \ +apk --no-cache --update add build-base + COPY requirements.txt ./ + RUN pip install --no-cache-dir -r requirements.txt COPY src . -CMD [ "flask", "run" ] +CMD [ "uwsgi", "--socket", "0.0.0.0:5000", "--protocol=http", "--wsgi-file", "./wsgi.py", "--callable", "application" ] diff --git a/requirements.txt b/requirements.txt index 265688d21e5a680bbbfc1903c3cf51c025277976..6cca06f521b7b1905c233947152c5e200a65a4f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,5 @@ MarkupSafe==2.0.1 python-dotenv==0.18.0 soupsieve==2.2.1 urllib3==1.26.6 +uWSGI==2.0.19.1 Werkzeug==2.0.1 diff --git a/src/wsgi.py b/src/wsgi.py new file mode 100644 index 0000000000000000000000000000000000000000..1043a11a14a30b17bad5f18d22e7bcadbc015687 --- /dev/null +++ b/src/wsgi.py @@ -0,0 +1,4 @@ +from app import app as application + +if __name__ == "__main__": + application.run() \ No newline at end of file