Dockerfile aktualisiert
This commit is contained in:
36
Dockerfile
36
Dockerfile
@@ -1,28 +1,24 @@
|
||||
# 1. Basis-Image: Ein modernes Python-Image, das auf Debian 12 (Bookworm) basiert
|
||||
FROM python:3.8-slim-bookworm
|
||||
FROM python:3.8-slim
|
||||
|
||||
# 2. Umgebungsvariablen setzen
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# 3. System-Abhängigkeiten installieren:
|
||||
# - Installiere Chromium UND den exakt passenden chromedriver.
|
||||
# - Dies eliminiert alle Versionskonflikte.
|
||||
RUN apt-get update && apt-get install -y \
|
||||
chromium \
|
||||
chromium-driver \
|
||||
--no-install-recommends && \
|
||||
# Install Google Chrome (nicht Chromium!) und passenden Chromedriver
|
||||
RUN apt-get update && apt-get install -y wget unzip gnupg && \
|
||||
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
|
||||
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y google-chrome-stable && \
|
||||
CHROME_VERSION=$(google-chrome --version | awk '{print $3}') && \
|
||||
CHROMEDRIVER_VERSION=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION%.*}) && \
|
||||
wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip && \
|
||||
unzip /tmp/chromedriver.zip -d /usr/local/bin/ && \
|
||||
chmod +x /usr/local/bin/chromedriver && \
|
||||
rm /tmp/chromedriver.zip && \
|
||||
apt-get remove -y wget unzip gnupg && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 4. Arbeitsverzeichnis im Container festlegen und einen Ausgabeordner erstellen
|
||||
WORKDIR /app
|
||||
RUN mkdir -p /app/output
|
||||
|
||||
# 5. Python-Abhängigkeiten installieren
|
||||
COPY requirements.txt .
|
||||
RUN pip3 install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 6. Den gesamten restlichen Projektcode kopieren
|
||||
COPY . .
|
||||
|
||||
# 7. Standardbefehl, der ausgeführt wird, wenn der Container gestartet wird
|
||||
CMD ["python3", "dealfront_enrichment.py"]
|
||||
CMD ["python3", "dealfront_enrichment.py"]
|
||||
|
||||
Reference in New Issue
Block a user