From 13d24aed1baab6bbaf50656168d95c7377d99114 Mon Sep 17 00:00:00 2001 From: Marcus Ahlfors Date: Wed, 17 Apr 2024 23:28:31 +0300 Subject: [PATCH] Fix runonce error with sh --- InitialProjectDockerfile | 6 ++---- diploi-runonce.sh | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/InitialProjectDockerfile b/InitialProjectDockerfile index 83608d5..fad9361 100644 --- a/InitialProjectDockerfile +++ b/InitialProjectDockerfile @@ -5,10 +5,8 @@ WORKDIR /app COPY initialProject . # Create production build -RUN npm install -RUN npm run build +RUN npm install && npm run build -# Create archive for quick launch (86M!, so not very smart) +# For quick launch (86M!, so not ideal) RUN git clone https://github.com/diploi/nextjs-postgresql-template-demo.git /app-quick-launch \ - && cd /app-quick-launch \ && npm install --prefix /app-quick-launch \ No newline at end of file diff --git a/diploi-runonce.sh b/diploi-runonce.sh index 2f2a4d4..a4acd67 100644 --- a/diploi-runonce.sh +++ b/diploi-runonce.sh @@ -29,10 +29,9 @@ if [ ! "$(ls -A /app)" ]; then ssh-keygen -A; if [ "$REPOSITORY_URL" = "https://github.com/diploi/nextjs-postgresql-template-demo.git" ]; then - # Using gzipped initial files (and node modules) + # Using quick launch cached initial files progress "Using quick launch /app"; - mv /app-quick-launch/* /app - mv /app-quick-launch/.* /app + find /app-quick-launch/ -mindepth 1 -maxdepth 1 -exec mv -t /app -- {} + rmdir /app-quick-launch else progress "Pulling code";