We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d7eba1 commit bcc676dCopy full SHA for bcc676d
2 files changed
Dockerfile
@@ -1,10 +1,22 @@
1
FROM python:3.11-slim
2
3
+# create non-root user
4
+RUN useradd -m appuser
5
+
6
WORKDIR /rag
7
8
COPY requirements.txt .
9
RUN pip install --no-cache-dir -r requirements.txt
10
11
COPY . .
12
13
+RUN chown -R appuser:appuser /rag
14
15
+# switch to non-root user
16
+USER appuser
17
18
+# healthcheck
19
+HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
20
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5000')" || exit 1
21
22
CMD ["python3", "-m", "app.api.testing_server"]
app/api/testing_server.py
@@ -154,4 +154,4 @@ def vote():
154
155
if __name__ == "__main__":
156
prepare_pairs()
157
- app.run(host="0.0.0.0", port=5000, debug=True)
+ app.run(host="0.0.0.0", port=5000, debug=False)
0 commit comments