docker: latest backend dockerization attempt but crash

This commit is contained in:
martin legrand
2025-05-29 15:34:23 +02:00
parent 58656ab43c
commit 95aeaf74fa
4 changed files with 34 additions and 13 deletions
+17 -10
View File
@@ -1,4 +1,5 @@
FROM ubuntu:22.04
FROM --platform=linux/amd64 ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /app
@@ -12,13 +13,15 @@ RUN apt-get update && apt-get install -y \
python3-pip \
python3-wheel \
build-essential \
# Chrome dependencies - comprehensive list
fonts-liberation \
libasound-dev \
libasound2 \
portaudio19-dev \
libatk-bridge2.0-0 \
libdrm2 \
libxcomposite1 \
libxdamage1 \
libfontconfig1 \
libxrandr2 \
libgbm1 \
libxss1 \
@@ -61,22 +64,26 @@ COPY .env .
COPY config.ini .
# Install Chrome and ChromeDriver from chrome-for-testing
RUN wget -O chrome-linux64.zip https://storage.googleapis.com/chrome-for-testing-public/136.0.7103.113/linux64/chrome-linux64.zip && \
wget -O chromedriver-linux64.zip https://storage.googleapis.com/chrome-for-testing-public/136.0.7103.113/linux64/chromedriver-linux64.zip && \
unzip chrome-linux64.zip && \
RUN wget -O chrome-headless-shell-linux64.zip https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/linux64/chrome-headless-shell-linux64.zip && \
wget -O chromedriver-linux64.zip https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/linux64/chromedriver-linux64.zip && \
unzip chrome-headless-shell-linux64.zip && \
unzip chromedriver-linux64.zip && \
mkdir -p /opt/google && \
ls -la && \
mv chrome-linux64 /opt/google/chrome && \
mv chrome-headless-shell-linux64 /opt/google/chrome && \
mv chromedriver-linux64/chromedriver /usr/local/bin/chromedriver && \
chmod +x /opt/google/chrome/chrome && \
chmod +x /opt/google/chrome/chrome-headless-shell && \
chmod +x /usr/local/bin/chromedriver
RUN ln -s /opt/google/chrome/chrome /usr/local/bin/chrome
# Verify Chrome and ChromeDriver installation
RUN google-chrome --version
RUN chromedriver --version > /dev/null 2>&1
# Debug ChromeDriver
RUN echo "=== ChromeDriver Debug ===" && \
/usr/local/bin/chromedriver --version && \
echo "Chrome binary:" && \
/opt/google/chrome/chrome --version && \
echo "Testing ChromeDriver startup:" && \
timeout 5 /usr/local/bin/chromedriver --port=9999 || echo "ChromeDriver failed to start"
ENV CHROME_BIN=/opt/google/chrome/chrome
ENV CHROMEDRIVER_PATH=/usr/local/bin/chromedriver