Skip to content

Instantly share code, notes, and snippets.

@ykzts
Created February 17, 2017 16:25
Show Gist options
  • Select an option

  • Save ykzts/4c25eaf4ae63534b2d43e909f943b0de to your computer and use it in GitHub Desktop.

Select an option

Save ykzts/4c25eaf4ae63534b2d43e909f943b0de to your computer and use it in GitHub Desktop.
FROM ubuntu:xenial
ENV PATH /usr/local/node-v6.9.5-linux-x64/bin:/usr/local/phantomjs-2.5.0-beta-ubuntu-xenial/bin:/root/.yarn/bin:${PATH}
RUN \
apt-get update && \
apt-get -y upgrade && \
apt-get -y --no-install-recommends install ca-certificates curl libfontconfig-dev libhyphen-dev libjpeg-dev libxslt-dev && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p /usr/local && \
curl -LsS https://nodejs.org/dist/v6.9.5/node-v6.9.5-linux-x64.tar.gz | tar xz -C /usr/local && \
curl -LsS https://yarnpkg.com/install.sh | bash -s -- --version 0.20.3 && \
curl -LsS https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.5.0-beta-linux-ubuntu-xenial-x86_64.tar.gz | tar xz -C /usr/local && \
chmod 744 /usr/local/phantomjs-2.5.0-beta-ubuntu-xenial/bin/phantomjs
WORKDIR /app
COPY package.json /app
COPY yarn.lock /app
RUN yarn install
COPY . /app
RUN yarn build
CMD ["phantomjs", "./build/crawler.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment