Skip to content

Commit

Permalink
Build for both AMD and ARM architectures
Browse files Browse the repository at this point in the history
Now working off the the node:current-alpine image, see
https://stackoverflow.com/a/72291691/2427596
  • Loading branch information
ccjmne committed Nov 21, 2023
1 parent 46b667e commit 25d2877
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: amd64,arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.TAG_VERSION }}
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM ghcr.io/puppeteer/puppeteer:latest
# See https://stackoverflow.com/a/72291691/2427596
FROM node:current-alpine

LABEL org.opencontainers.image.source https://github.com/ccjmne/puppeteer-html2pdf

USER root

RUN apk add chromium

# https://github.com/Yelp/dumb-init
RUN apt-get update && apt-get install -y dumb-init
RUN apk update && apk add dumb-init

WORKDIR /app
ADD . .
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Technologies used:
- [Express](https://expressjs.com/)
- [NodeJS](https://nodejs.org/en/)

It offers images for both ARM and AMD architectures.

## Run it

As a webserver, on the port of your choosing.
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function parseRequest(request) {
export function use(puppeteer) {
function launchBrowser() {
return puppeteer.launch({
executablePath: 'google-chrome-stable',
executablePath: 'chromium-browser',
headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
Expand Down

0 comments on commit 25d2877

Please sign in to comment.