Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNaessens committed Mar 17, 2024
1 parent 4fbf3b2 commit 6a7a572
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM ruby:3.3.0

ENV RAILS_ENV=production

RUN adduser --system --group factuur

WORKDIR /app

# Install Yarn
Expand All @@ -18,12 +16,8 @@ RUN bundle install

COPY . /app

RUN chown -R factuur:factuur /app

RUN yarn install

RUN bundle exec rails assets:precompile

USER factuur

CMD bundle exec rails s -b 0.0.0.0
4 changes: 3 additions & 1 deletion app/models/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def generate_pdf
Dir.mktmpdir do |dir|
# TODO: Put this in a config
# command = 'electron-pdf'
exe = 'node_modules/.bin/electron-pdf'
browser_config = '{ "webPreferences": { "sandbox" : false } }'
exe = "node_modules/.bin/electron-pdf --browserConfig #{browser_config}"

exe.prepend('xvfb-run -n 9 ') if Rails.env.production?
input_file = "#{dir}/input.html"
output_file = "#{dir}/output.pdf"
Expand Down

0 comments on commit 6a7a572

Please sign in to comment.