mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 04:04:36 +08:00
Fix Chromium execution failure in Docker containers (#7887)
This commit is contained in:
parent
a4f5b3c724
commit
27a0f462eb
4 changed files with 5 additions and 4 deletions
|
@ -28,7 +28,7 @@ RUN apt-get update -qq && \
|
|||
|
||||
ENV PATH=/usr/share/nodejs/yarn/bin:$PATH
|
||||
|
||||
RUN yarn add puppeteer@npm:puppeteer-core
|
||||
RUN yarn add puppeteer@npm:puppeteer-core@^22.15.0
|
||||
|
||||
ENV BUNDLE_PATH /usr/local/bundle/
|
||||
|
||||
|
@ -39,7 +39,7 @@ RUN mkdir $APP_HOME
|
|||
RUN adduser --uid 1000 scinote
|
||||
RUN chown scinote:scinote $APP_HOME
|
||||
USER scinote
|
||||
ENV CHROMIUM_PATH /usr/bin/chromium
|
||||
ENV CHROMIUM_PATH=$APP_HOME/bin/chromium
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
CMD rails s -b 0.0.0.0
|
||||
|
|
|
@ -104,7 +104,6 @@ USER scinote
|
|||
|
||||
COPY --from=builder --chown=scinote:scinote $APP_HOME $APP_HOME
|
||||
|
||||
ENV CHROMIUM_PATH /usr/bin/chromium
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
CMD rails s -b 0.0.0.0
|
||||
|
|
2
bin/chromium
Executable file
2
bin/chromium
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
env -i /usr/bin/chromium $@
|
|
@ -3,7 +3,7 @@
|
|||
Grover.configure do |config|
|
||||
config.options = {
|
||||
cache: false,
|
||||
executable_path: ENV['CHROMIUM_PATH'] || '/usr/bin/chromium',
|
||||
executable_path: ENV['CHROMIUM_PATH'] || './bin/chromium',
|
||||
launch_args: %w(--disable-dev-shm-usage --disable-gpu --no-sandbox),
|
||||
timeout: Constants::GROVER_TIMEOUT_MS
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue