Alibrown commited on
Commit
1eb7900
·
verified ·
1 Parent(s): 3faff69

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -3
Dockerfile CHANGED
@@ -1,12 +1,28 @@
 
1
  FROM python:3.10-slim
2
 
3
- WORKDIR /app
 
4
 
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY . .
 
 
 
 
9
 
10
- EXPOSE 8080
 
 
11
 
 
12
  CMD ["python", "app/app.py"]
 
1
+ # Basis-Image
2
  FROM python:3.10-slim
3
 
4
+ # Arbeitsverzeichnis setzen
5
+ WORKDIR /code
6
 
7
+ # System-Dependencies
8
+ RUN apt-get update && \
9
+ apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Requirements kopieren und installieren
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # App-Code kopieren
18
+ COPY ./app /code/app
19
+
20
+ # Port freigeben
21
+ EXPOSE 7860
22
 
23
+ # Healthcheck hinzufügen
24
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
25
+ CMD curl -f http://localhost:7860/ || exit 1
26
 
27
+ # Start-Command
28
  CMD ["python", "app/app.py"]