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