Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorcy committed Nov 28, 2023
1 parent a7fdd91 commit f3f1fd4
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 34 deletions.
34 changes: 5 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7.7
FROM ruby:2.7.5

ARG RAILS_ENV
ARG SECRET_KEY_BASE
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/env.apple-silicon.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions config/env.intel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
29 changes: 29 additions & 0 deletions docs/future_notes.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit f3f1fd4

Please sign in to comment.