FreshPixels commited on
Commit
238a731
·
verified ·
1 Parent(s): 737ae4c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile CHANGED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN groupadd -r appgroup && useradd -r -m -g appgroup appuser
6
+
7
+ COPY requirements.txt .
8
+ RUN pip install --no-cache-dir -r requirements.txt
9
+
10
+ COPY . .
11
+
12
+ RUN chown -R appuser:appgroup /app
13
+
14
+ EXPOSE 7860
15
+
16
+ USER appuser
17
+
18
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
19
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1
20
+
21
+ CMD ["python", "app.py"]