feat(sully): prepare scully for running inside Docker container#109
feat(sully): prepare scully for running inside Docker container#109SanderElias merged 1 commit intoscullyio:masterfrom
Conversation
|
@beeman Can you please describe what the puppeteer options you added do to make this better prepared for Docker? I believe you but I want to learn what is going on in this PR. |
|
@aaronfrost on our dev machines when installing Take for instance a Docker images that's based on Alpine. In that case the solution is to prepare the Docker image and install chromium using that OS' package manager, and instruct Puppeteer to not download it (by setting the env var With this PR we can instruct Puppeteer that we want to change the In this case I prepared a Docker image to include Chromium like this, and instruct it not to download Puppeteer when installed from npm: FROM node:12-alpine
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD trueIn order to use this I create my projects' Docker file like this: FROM beeman/scully-docker:latest
ENV SCULLY_PUPPETEER_EXECUTABLE_PATH '/usr/bin/chromium-browser'
... more docker stuff here
... and eventually run Scully:
RUN yarn scullyHappy to elaborate more if needed! |
|
@beeman we need to update the commit when we get this merged. The commit says "feat(sully)" when it should have a C and say "feat(s__c__ully)". |
SanderElias
left a comment
There was a problem hiding this comment.
LGTM,
I will merge when the conflicts are resolved.
023a114 to
1e25d52
Compare
|
@aaronfrost commit message is renamed |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently when running scully in a Docker container it fails with an error message similar to this:
What is the new behavior?
This PR adds the option to instruct Scully to use an existing chromium as executable, allowing it to run inside a Docker container.
It introduces support for the
SCULLY_PUPPETEER_EXECUTABLE_PATHenv var, if this is found it uses it's value as theexecutablePathfor Puppeteer.This allows for running Scully with a prepared Docker image, like beeman/scully-docker.
After this patch, scully uses the browser that's pre-installed in the images and runs perfectly fine!
Does this PR introduce a breaking change?
Other information
Most of the information to build this feature comes from here.