mirror of
https://github.com/newnius/Dockerfiles.git
synced 2025-06-07 16:41:55 +00:00
update hexo
This commit is contained in:
parent
630280e880
commit
b1af49988d
@ -1,21 +1,11 @@
|
|||||||
FROM node:latest
|
FROM node:9.3-alpine
|
||||||
|
|
||||||
MAINTAINER Newnius <docker@newnius.com>
|
MAINTAINER Newnius <newnius.cn@gmail.com>
|
||||||
|
|
||||||
RUN apt-get -y update && apt-get -y install git && npm install -g hexo-cli
|
RUN apk update && apk add git
|
||||||
|
|
||||||
RUN npm install hexo-generator-feed --save
|
|
||||||
|
|
||||||
#Local Search
|
|
||||||
RUN npm install hexo-generator-searchdb --save
|
|
||||||
|
|
||||||
RUN npm install --save hexo-algolia@0.2.0
|
|
||||||
|
|
||||||
RUN npm install hexo-deployer-git --save
|
|
||||||
|
|
||||||
|
RUN npm install hexo-cli -g
|
||||||
|
|
||||||
ADD bootstrap.sh /etc/bootstrap.sh
|
ADD bootstrap.sh /etc/bootstrap.sh
|
||||||
|
|
||||||
WORKDIR /blog
|
CMD ["/etc/bootstrap.sh", "development"]
|
||||||
|
|
||||||
ENTRYPOINT ["/etc/bootstrap.sh"]
|
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
#! /bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
|
# configure git
|
||||||
git config --global user.email $GIT_EMAIL
|
git config --global user.email $GIT_EMAIL
|
||||||
git config --global user.name $GIT_NAME
|
git config --global user.name $GIT_NAME
|
||||||
|
|
||||||
if [ "$1" = "server" ]; then
|
# init hexo if dir is empty
|
||||||
# start hexo server
|
if ! [ "$(ls -A blog)" ]; then
|
||||||
echo "starting hexo..."
|
hexo init blog && npm install blog
|
||||||
hexo server
|
fi
|
||||||
else
|
|
||||||
# do nothing, just wait
|
# run hexo as production / developemnt mode
|
||||||
while true; do sleep 1000; done
|
if [[ $1 == "production" ]]; then
|
||||||
|
hexo server
|
||||||
|
else
|
||||||
|
hexo server -s
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user