Last active
February 12, 2021 08:33
-
-
Save henriquebf/62e98736c57c24c94938 to your computer and use it in GitHub Desktop.
Dockerfile with Node.js, Imagemagick (with native support) and Gulp build tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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