Skip to content

Instantly share code, notes, and snippets.

@henriquebf
Last active February 12, 2021 08:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henriquebf/62e98736c57c24c94938 to your computer and use it in GitHub Desktop.
Save henriquebf/62e98736c57c24c94938 to your computer and use it in GitHub Desktop.
Dockerfile with Node.js, Imagemagick (with native support) and Gulp build tasks
FROM node:0.12.7-wheezy
# Install tools & libs to compile everything
RUN apt-get update && apt-get install -y build-essential libssl-dev libreadline-dev wget && apt-get clean
# Install imagemagick with support to native library
RUN apt-get install -y imagemagick libmagick++-dev libmagic-dev && apt-get clean
ENV PATH=$PATH:~/opt/bin:~/opt/node/bin:/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16
# Install global CLIs
RUN npm install -g gulp node-sass
RUN npm rebuild node-sass
# Commands will run in this directory
WORKDIR /home/app
# cache package.json and node_modules to speed up builds
ADD package.json /home/app/package.json
RUN npm install
# Add all our code inside that directory that lives in the container
ADD . /home/app
# Install dependencies and generate production dist
RUN npm run publish
CMD ["npm","start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment