From d556f8d34d273cea38944f53869e03019a3b3f9f Mon Sep 17 00:00:00 2001 From: Matt Langlois Date: Tue, 22 Nov 2022 08:41:33 +0000 Subject: [PATCH] More fixes --- Dockerfile | 6 ------ setup/bootstrap.sh | 8 -------- setup/run.sh | 16 ++++++++++++---- 3 files changed, 12 insertions(+), 18 deletions(-) delete mode 100755 setup/bootstrap.sh diff --git a/Dockerfile b/Dockerfile index 3293d7c..390aa2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,11 +2,5 @@ FROM node:19 COPY setup /setup -# Install requirements -RUN (cd /setup; sh bootstrap.sh) - -# Set the work directory to blog -WORKDIR /config - # Start the server CMD ["/bin/bash", "/setup/run.sh"] diff --git a/setup/bootstrap.sh b/setup/bootstrap.sh deleted file mode 100755 index 72515af..0000000 --- a/setup/bootstrap.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# Used to install rsync for deployments -apt-get update -y -apt-get -y install rsync - -# Install HEXO -npm install -g hexo diff --git a/setup/run.sh b/setup/run.sh index ff502be..0461cf1 100755 --- a/setup/run.sh +++ b/setup/run.sh @@ -1,5 +1,14 @@ #!/bin/bash +# Used to install rsync for deployments +echo "Installing rsync for deployments" +apt-get update -y +apt-get -y install rsync + +# Install HEXO +echo "Installing hexo.." +npm install -g hexo + # Check to ensure the /config volume is mounted if [ ! -d "/config" ]; then echo "Please mount a /config directory so you blog persists upon container restarts!" @@ -20,13 +29,12 @@ if [[ -z "${HEXO_PLUGINS}" ]]; then echo "No additional plugins to install!" else echo "Installing additional plugins \"${HEXO_PLUGINS}\"" - npm install "${HEXO_PLUGINS}" + npm install -C /config ${HEXO_PLUGINS} fi # Start the server echo "Starting hexo server on port 8080" # Start fresh -cd /config || exit 1 -hexo clean || true -hexo server -p 8080 --debug --draft +hexo clean --cwd /config +hexo server --cwd /config -p 8080 --debug --draft