Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Dockerfile-api
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ ENV COUNTLY_CONTAINER="api" \
COUNTLY_CONFIG_API_API_WORKERS="1" \
COUNTLY_CONFIG_API_API_HOST="0.0.0.0" \
NODE_OPTIONS="--max-old-space-size=2048" \
TINI_VERSION="0.18.0"

TINI_VERSION="0.18.0"\
PUPPETEER_CACHE_DIR=/opt/countly/.cache/puppeteer

WORKDIR /opt/countly
COPY . .

Expand Down Expand Up @@ -58,7 +59,7 @@ RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/downlo
# cleanup & chown
npm remove -y --no-save mocha nyc should supertest && \
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 && \
apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
apt-get install -y libgbm-dev libgbm1 gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \
\
Expand All @@ -75,4 +76,4 @@ USER 1001:0

ENTRYPOINT ["/usr/bin/tini", "-v", "--"]

CMD ["/opt/countly/bin/docker/cmd.sh"]
CMD ["/opt/countly/bin/docker/cmd.sh"]
12 changes: 10 additions & 2 deletions api/utils/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ exports.renderView = function(options, cb) {

var settings = {
headless: true,
env: {
//https://github.com/hardkoded/puppeteer-sharp/issues/2633
XDG_CONFIG_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium"),
XDG_CACHE_HOME: pathModule.resolve(__dirname, "../../.cache/chrome/tmp/.chromium")
},
args: ['--no-sandbox', '--disable-setuid-sandbox'],
ignoreHTTPSErrors: true,
userDataDir: pathModule.resolve(__dirname, "../../dump/chrome")
Expand Down Expand Up @@ -118,8 +123,11 @@ exports.renderView = function(options, cb) {
};

page.setDefaultNavigationTimeout(updatedTimeout);

await page.goto(host + '/login/token/' + token + '?ssr=true');
const resp = await page.goto(host + '/login/token/' + token + '?ssr=true');
const status = resp?.status();
if (status !== 200) {
throw new Error(`Failed to open login page. Status: ${status}`);
}

await page.waitForSelector('countly', {timeout: updatedTimeout});

Expand Down
2 changes: 1 addition & 1 deletion bin/countly.install_rhel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ else
fi

#Install dependancies required by the puppeteer
sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils
sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXrandr.x86_64 GConf2.x86_64 libXScrnSaver.x86_64 libXtst.x86_64 pango.x86_64 xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-misc xorg-x11-fonts-Type1 xorg-x11-utils libdrm libgbm at-spi2-atk libxkbcommon
#Install nss after installing above dependencies
sudo dnf update -y nss

Expand Down
Loading
Loading