From 079afaa3306cce003f9ce95afb8d9223ab7f6a0d Mon Sep 17 00:00:00 2001 From: "J. Q." <55899496+jawadqur@users.noreply.github.com> Date: Thu, 2 Jan 2025 09:41:58 -0600 Subject: [PATCH 1/3] Add start.sh to correct build stage --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index af67838..cecf2d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ RUN npm ci COPY ./src ./src COPY ./public ./public COPY ./config ./config -COPY ./start.sh ./ RUN npm install @swc/core @napi-rs/magic-string && \ npm run build @@ -24,6 +23,7 @@ RUN addgroup --system --gid 1001 nextjs && \ COPY --from=builder /gen3/config ./config COPY --from=builder /gen3/public ./public COPY --from=builder /gen3/.next/static ./.next/static +COPY ./start.sh ./ USER nextjs ENV PORT=3000 From c03690ea4bf9bda4ad042322917a19701d404bc9 Mon Sep 17 00:00:00 2001 From: craigrbarnes Date: Thu, 2 Jan 2025 10:22:57 -0600 Subject: [PATCH 2/3] update Docker and start.sh --- Dockerfile | 2 +- start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cecf2d6..bdda04a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN addgroup --system --gid 1001 nextjs && \ COPY --from=builder /gen3/config ./config COPY --from=builder /gen3/public ./public COPY --from=builder /gen3/.next/static ./.next/static -COPY ./start.sh ./ +COPY --from=builder /gen3/start.sh ./ USER nextjs ENV PORT=3000 diff --git a/start.sh b/start.sh index 5cf0f39..9d978d1 100644 --- a/start.sh +++ b/start.sh @@ -2,4 +2,4 @@ set -e echo "starting server" -npm run start +next start From 2168f0ec65da46fcba00cf999e9c62fe7e2a3f10 Mon Sep 17 00:00:00 2001 From: craigrbarnes Date: Thu, 2 Jan 2025 12:42:31 -0600 Subject: [PATCH 3/3] update Docker and start.sh --- Dockerfile | 5 +++-- start.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bdda04a..a264c14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,10 +20,11 @@ ENV PORT=3000 RUN addgroup --system --gid 1001 nextjs && \ adduser --system --uid 1001 nextjs +COPY --from=builder /gen3/node_modules ./node_modules COPY --from=builder /gen3/config ./config COPY --from=builder /gen3/public ./public -COPY --from=builder /gen3/.next/static ./.next/static -COPY --from=builder /gen3/start.sh ./ +COPY --from=builder --chown=nextjs:nextjs /gen3/.next ./.next +COPY --from=builder /gen3/start.sh /gen3/package.json ./ USER nextjs ENV PORT=3000 diff --git a/start.sh b/start.sh index 9d978d1..5cf0f39 100644 --- a/start.sh +++ b/start.sh @@ -2,4 +2,4 @@ set -e echo "starting server" -next start +npm run start