Skip to content

Instantly share code, notes, and snippets.

@huyinjie
Last active November 25, 2017 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huyinjie/4280aeb8a1e7631dd0cd23eded146ecc to your computer and use it in GitHub Desktop.
Save huyinjie/4280aeb8a1e7631dd0cd23eded146ecc to your computer and use it in GitHub Desktop.
#!/bin/sh
RESUME_PATH="$HOME/resume"
RESUME_PORT="$1"
echo "Port: ${RESUME_PORT:="8080"}"
command -v docker >/dev/null 2>&1
if [ $? != 0 ]; then curl -sSL https://get.docker.com/ | sh; fi
mkdir -p $RESUME_PATH
docker run -d --name resume_tmp zuolan/resume
if [ ! -d "$RESUME_PATH/pages" ]; then
docker cp resume_tmp:/usr/html/user/config $RESUME_PATH/config
fi
if [ ! -d "$RESUME_PATH/pages" ]; then
docker cp resume_tmp:/usr/html/user/pages $RESUME_PATH/pages
fi
docker rm -f resume_tmp resume >/dev/null 2>&1
docker run -d --name resume -p $RESUME_PORT:80 \
-v $RESUME_PATH/pages:/usr/html/user/pages \
-v $RESUME_PATH/config/:/usr/html/user/config/ \
-v $RESUME_PATH/static/:/usr/html/static \
--restart=always zuolan/resume
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment