Skip to content

Instantly share code, notes, and snippets.

@jamespan
Last active July 11, 2019 04:37
Show Gist options
  • Save jamespan/23528eeaaaa4120ef637 to your computer and use it in GitHub Desktop.
Save jamespan/23528eeaaaa4120ef637 to your computer and use it in GitHub Desktop.
A Dockerfile for Hexo 3.0
FROM ubuntu:14.04
MAINTAINER Pan Jiabang, [email protected]
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