Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|