Skip to content

Commit

Permalink
Tell phantomas were Chromium binary is
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed May 3, 2019
1 parent d3928d0 commit c55e138
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
node_modules/
docs/
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ WORKDIR /opt/phantomas
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Puppeteer v1.15.0 works with Chromium 75 // keep in sync with version in package.json
ENV PUPPETEER_VERSION 1.15.0

RUN npm i --no-save puppeteer@$PUPPETEER_VERSION
# Tell phantomas were Chromium binary is
ENV PHANTOMAS_CHROMIUM_EXECUTABLE /usr/bin/chromium-browser

# Add user so we don't need --no-sandbox.
RUN addgroup -S phantomas && adduser -S -g phantomas phantomas \
Expand All @@ -30,3 +28,12 @@ RUN addgroup -S phantomas && adduser -S -g phantomas phantomas \
# Run everything after as non-privileged user.
USER phantomas

# Copy the content of the repository into a container
COPY . /opt/phantomas

# and install dependencies
RUN npm i

# test it (if needed)
#RUN ./test/server-start.sh &
#RUN sleep 2 && npm t

0 comments on commit c55e138

Please sign in to comment.