From be65d2a62a8e32df40cb239fbe3c2694d343c180 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sat, 28 Oct 2023 09:00:55 +0200 Subject: [PATCH] Use uwsgi in Docker * Use uwsgi HTTP server when running in Docker. * Change Docker user to nobody. Signed-off-by: SuperQ --- Dockerfile | 7 +++++-- uwsgi.ini | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 uwsgi.ini diff --git a/Dockerfile b/Dockerfile index baeac8d..f5c9033 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,9 @@ COPY . /app/ RUN pip install -r /app/requirements.txt -EXPOSE 8000 +EXPOSE 5000 -ENTRYPOINT ["/usr/bin/env", "python3", "/app/controller.py"] +USER nobody + +ENTRYPOINT ["/usr/bin/env", "uwsgi", "--http", ":5000", "--ini", "uwsgi.ini"] +CMD ["--processes", "2", "--threads", "2"] diff --git a/uwsgi.ini b/uwsgi.ini new file mode 100644 index 0000000..2d2a1ee --- /dev/null +++ b/uwsgi.ini @@ -0,0 +1,4 @@ +[uwsgi] +wsgi-file = controller.py +callable = app +master = true