From f3f1fd4f62126447de4ed150b37897de64a562a0 Mon Sep 17 00:00:00 2001 From: Mike Korcynski Date: Tue, 28 Nov 2023 15:48:26 -0500 Subject: [PATCH] wip --- Dockerfile | 34 +++++----------------------------- config/env.apple-silicon.conf | 4 ++-- config/env.intel.conf | 4 ++-- docker-compose.yml | 2 +- docs/future_notes.md | 29 +++++++++++++++++++++++++++++ 5 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 docs/future_notes.md diff --git a/Dockerfile b/Dockerfile index 516d078..a838d22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7.7 +FROM ruby:2.7.5 ARG RAILS_ENV ARG SECRET_KEY_BASE @@ -15,36 +15,12 @@ ENV LC_ALL C.UTF-8 # --allow-unauthenticated needed for yarn package RUN apt-get update && apt-get upgrade -y && \ apt-get install --no-install-recommends -y ca-certificates nodejs \ - build-essential libpq-dev libreoffice imagemagick unzip ghostscript vim \ + build-essential libpq-dev libreoffice unzip ghostscript vim \ + ffmpeg \ + clamav-freshclam clamav-daemon libclamav-dev \ libqt5webkit5-dev xvfb xauth default-jre-headless --fix-missing --allow-unauthenticated -RUN apt-get update && apt-get install -y wget gnupg -RUN apt-get install -y wget apt-transport-https gnupg -RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list - -RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public| apt-key add - \ - && apt-get update \ - && apt-get install -y temurin-8-jdk - -RUN update-java-alternatives --set /usr/lib/jvm/temurin-8-jdk-amd64 - -RUN apt-get update && apt-get install -y wget unzip libatk1.0-0 libgtk-3-0 libgbm1 - -# Download and extract Google Chrome -RUN wget https://github.com/Alex313031/thorium/releases/download/M114.0.5735.134/thorium-browser_114.0.5735.134_amd64.zip && \ - unzip chrome-linux.zip -d /usr/local/bin/ && \ - rm chrome-linux.zip - -# Create a symbolic link to the Chrome binary -RUN ln -s /usr/local/bin/thorium /usr/local/bin/google-chrome -RUN ln -s /usr/local/bin/thorium /usr/local/bin/chrome -RUN ln -s /usr/local/bin/thorium /usr/local/bin/chromium - -# Cleanup unnecessary files -RUN apt-get remove -y wget unzip && apt-get clean - -# Verify the installation -RUN google-chrome --version +RUN apt-get install chromium -y # Increase stack size limit to help working with large works ENV RUBY_THREAD_MACHINE_STACK_SIZE 8388608 diff --git a/config/env.apple-silicon.conf b/config/env.apple-silicon.conf index efc681d..4926778 100644 --- a/config/env.apple-silicon.conf +++ b/config/env.apple-silicon.conf @@ -2,8 +2,8 @@ SERVER_PORTS="4000:4000" SERVER_EXPOSE="4000" -TEST_PORTS="4001:4001" -TEST_EXPOSE="4001" +TEST_PORTS="4101:4001" +TEST_EXPOSE="4111" # APPLE SILICONE SETTINGS SELENIUM_IMAGE="seleniarm/standalone-chromium" diff --git a/config/env.intel.conf b/config/env.intel.conf index aa20886..0b9c646 100644 --- a/config/env.intel.conf +++ b/config/env.intel.conf @@ -2,8 +2,8 @@ SERVER_PORTS="4000:4000" SERVER_EXPOSE="4000" -TEST_PORTS="4001:4001" -TEST_EXPOSE="4001" +TEST_PORTS="4101:4001" +TEST_EXPOSE="4111" # INTEL SETTINGS SELENIUM_IMAGE="selenium/standalone-chrome:3.141" diff --git a/docker-compose.yml b/docker-compose.yml index eb9649b..6de318e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -136,7 +136,7 @@ services: - MYSQL_PASSWORD=postgres - MYSQL_ROOT_PASSWORD=postgres ports: - - 3308:3308 + - 3418:3308 tmpfs: /var/lib/mysql chrome: image: "${SELENIUM_IMAGE}" diff --git a/docs/future_notes.md b/docs/future_notes.md new file mode 100644 index 0000000..429fcb1 --- /dev/null +++ b/docs/future_notes.md @@ -0,0 +1,29 @@ +# Some ideas on supporting different chrome/java versions + +In trying this in trove it didn't work great because of the differences in ARM and x64 macs. + +## alternative java installation +``` +RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public| apt-key add - \ + && apt-get update \ + && apt-get install -y temurin-8-jdk + +RUN update-java-alternatives --set /usr/lib/jvm/temurin-8-jdk-amd64 + +RUN apt-get update && apt-get install -y wget unzip libatk1.0-0 libgtk-3-0 libgbm1 +``` +## Download and extract Google Chrome + +attempts using thorium + +``` +RUN wget https://github.com/Alex313031/thorium/releases/download/M114.0.5735.134/thorium-browser_114.0.5735.134_amd64.zip && \ + unzip chrome-linux.zip -d /usr/local/bin/ && \ + rm chrome-linux.zip +``` +## Create a symbolic link to the Chrome binary +``` +RUN ln -s /usr/local/bin/thorium /usr/local/bin/google-chrome +RUN ln -s /usr/local/bin/thorium /usr/local/bin/chrome +RUN ln -s /usr/local/bin/thorium /usr/local/bin/chromium +``` \ No newline at end of file