Skip to content

Commit

Permalink
Get grover & puppeteer working in base image
Browse files Browse the repository at this point in the history
Puppeteer uses a headless chromium which has some dependencies we
can be provided by installing chrome, so do that.

The default seccomp policy prevents chrome sandbox for working.
There are numerous suggested ways to fix that, but I was having
problems making it work consistently, so I'll start with
"unconfined" and try to figure it out a stricter policy in a future
commit.

See also:
* https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox
* jessfraz/dockerfiles#65 (comment)
* https://github.com/moby/moby/blob/master/profiles/seccomp/default.json
* https://docs.docker.com/engine/security/seccomp/
* https://kubernetes.io/docs/tutorials/security/seccomp/
  • Loading branch information
simonbaird committed Aug 19, 2022
1 parent 68af69c commit 921ec4f
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 25 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ gem "aws-sdk-s3", require: false
# For nice emails
gem 'bootstrap-email'

# For thumbnails and screenshots
gem 'grover'

# For payments
gem 'pay', '~> 3.0'
gem 'stripe', '>= 2.8', '< 6.0'
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (4.1.0)
combine_pdf (1.0.22)
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.1.10)
crass (1.0.6)
css_parser (1.11.0)
Expand All @@ -118,6 +121,9 @@ GEM
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
grover (1.1.1)
combine_pdf (~> 1.0)
nokogiri (~> 1.0)
haml (5.2.2)
temple (>= 0.8.0)
tilt
Expand Down Expand Up @@ -216,6 +222,7 @@ GEM
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
ruby-rc4 (0.1.5)
ruby_parser (3.19.1)
sexp_processor (~> 4.16)
rubyzip (2.3.2)
Expand Down Expand Up @@ -288,6 +295,7 @@ DEPENDENCIES
dalli
devise
devise-security
grover
haml-rails
jbuilder (~> 2.7)
net-imap
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.0.0",
"jquery": "^3.6.0",
"puppeteer": "^16.1.0",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12"
},
Expand Down
Loading

0 comments on commit 921ec4f

Please sign in to comment.