Skip to content

Instantly share code, notes, and snippets.

@MohammedEssehemy
Created January 5, 2019 12:02
Show Gist options
  • Save MohammedEssehemy/ab084a744c419943a75ad6fa5eb9f02b to your computer and use it in GitHub Desktop.
Save MohammedEssehemy/ab084a744c419943a75ad6fa5eb9f02b to your computer and use it in GitHub Desktop.
node with canvas and pdfjs #node #canvas #pdfjs
FROM node:10-alpine
LABEL maintainer="Mohammed Essehemy <mohammedessehemy@gmail.com>"
WORKDIR /source
COPY package.json .
# .npm-deps https://github.com/Automattic/node-canvas/issues/866
RUN apk add --no-cache --virtual .build-deps git build-base g++ && \
apk add --no-cache cairo-dev libjpeg-turbo-dev pango-dev && \
npm install --production && npm audit fix && npm cache clean --force && \
apk del .build-deps && rm -rf /var/cache/apk/*
ADD ./ .
RUN chown node:node -R /source
USER node
CMD node ./index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment