diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b84cac1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +.nuxt +dist +.git \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..8862245 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +# Clone of pull repo +if [ ! -d ".git" ]; then + echo "Cloning repo..." + git clone -b ${GIT_BRANCH:-main} ${GIT_REPO_URL} . +else + echo "Pulling latest changes..." + git reset --hard + git clean -fd + git pull origin ${GIT_BRANCH:-main} +fi + +# Dependencies +echo "Installing dependencies..." +npm install + +# Build +echo "Building Nuxt app..." +npm run build + +# Start +echo "Starting Nuxt app..." +exec npm run start \ No newline at end of file