From dee88bbd1a285ccff920027e11147fb357841ca5 Mon Sep 17 00:00:00 2001 From: Cameron Fleming Date: Sat, 27 Jun 2020 18:03:24 +0100 Subject: Create docker files Allow's cState to run under Docker. --- docker/entrypoint.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docker/entrypoint.sh (limited to 'docker/entrypoint.sh') diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..f8068c1 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,21 @@ +WORK_DIR="/app" +SRC_DIR="/cstate" + +# Check if the working dir is empty, if it is we'll need to copy +# the files in from src directory (usually /cstate) +if ! [ "$(ls -A $WORK_DIR)" ]; then + # First run, copy cstate's files in. + echo "First time run! Hello, World :)" + cp -R $SRC_DIR/* $WORK_DIR +fi + +# Continue with building + +# CD into working dir +cd /app + +# Build the hugo site +hugo + +# Copy built files into NGINX directory +cp -r /app/public/* /usr/share/nginx/html \ No newline at end of file -- cgit v1.2.3-70-g09d2