-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (32 loc) · 988 Bytes
/
Dockerfile
File metadata and controls
42 lines (32 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.11-slim
# Arbeitsverzeichnis setzen
WORKDIR /app
# System-Abhängigkeiten installieren
RUN apt-get update && apt-get install -y \
gcc \
g++ \
default-libmysqlclient-dev \
pkg-config \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# Python-Abhängigkeiten kopieren und installieren
COPY requirements.txt .
# Pip upgraden und mit Retry-Mechanismus installieren
# Erhöhte Timeouts und Retries für stabilere Builds
RUN pip install --upgrade pip && \
pip install --no-cache-dir \
--timeout=300 \
--retries=5 \
-r requirements.txt
# Anwendungsdateien kopieren
COPY . .
# Verzeichnisse für Uploads, Daten und Logs erstellen
RUN mkdir -p /app/import /app/data/invoices /app/data/paperless /app/data/log
# Port freigeben
EXPOSE 5001
# Entrypoint-Script ausführbar machen
RUN chmod +x /app/docker-entrypoint.sh
# Entrypoint setzen
ENTRYPOINT ["/app/docker-entrypoint.sh"]
# Standard-Command
CMD ["python", "app.py"]