Skip to content

Instantly share code, notes, and snippets.

@roshanca
Forked from jamespan/dockerfile-hexo
Last active August 29, 2015 14:19
Show Gist options
  • Save roshanca/d5b4e4ab56e93ceaf883 to your computer and use it in GitHub Desktop.
Save roshanca/d5b4e4ab56e93ceaf883 to your computer and use it in GitHub Desktop.
FROM ubuntu:14.04
MAINTAINER Pan Jiabang, panjiabang@gmail.com
RUN \
# use aliyun's mirror for better download speed
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y nodejs curl git-core && \
# use nodejs as node
update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10 && \
# install npm
curl -L https://npmjs.org/install.sh | sh && \
# clean up install cache
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /root
RUN \
mkdir blog && cd blog && \
# install hexo
npm install hexo-cli -g && \
hexo init && tnpm install && \
# install plugins for hexo
npm install hexo-generator-sitemap --save && \
npm install hexo-generator-feed --save && \
npm install hexo-deployer-git --save && \
npm un hexo-renderer-marked --save && \
npm i hexo-renderer-markdown-it --save
WORKDIR /root/blog/
VOLUME ["/root/blog/source"]
VOLUME ["/root/blog/themes"]
EXPOSE 4000
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment