diff --git a/entrypoint.sh b/entrypoint.sh index 33d1e3c..435bb74 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,12 +1,14 @@ #!/bin/bash set -e -# Als repo nog niet bestaat, clone +TEMP_DIR="/tmp/nuxt_repo" + +# Als repo nog niet bestaat, clone naar tijdelijke map if [ ! -d ".git" ]; then - echo "Cloning repo..." - echo "GIT_REPO_URL: ${GIT_REPO_URL}" - echo "GIT_BRANCH: ${GIT_BRANCH:-main}" - git clone -b ${GIT_BRANCH:-main} ${GIT_REPO_URL} . + echo "Cloning repo to temporary folder..." + git clone -b ${GIT_BRANCH:-main} ${GIT_REPO_URL} $TEMP_DIR + echo "Copying files to /app..." + cp -R $TEMP_DIR/* $TEMP_DIR/.[!.]* /app/ 2>/dev/null || true else echo "Pulling latest changes..." git reset --hard @@ -14,10 +16,10 @@ else git pull origin ${GIT_BRANCH:-main} fi -# Dependencies +# Dependencies installeren npm ci -# Build +# Build Nuxt npm run build # Start Nuxt