From a23d46061895de0cf1ac7580fc2257a9df9acb2e Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Tue, 10 Dec 2024 22:03:38 -0500 Subject: [PATCH] add start (#10) * add start * update Docker file, add start.sh --- Dockerfile | 5 +++-- start.sh | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 start.sh diff --git a/Dockerfile b/Dockerfile index b2dcee5..7266bc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG NEXT_PUBLIC_PORTAL_BASENAME WORKDIR /gen3 -COPY ./package.json ./package-lock.json ./next.config.js ./tsconfig.json ./.env.development ./tailwind.config.js ./postcss.config.js ./ +COPY ./package.json ./package-lock.json ./next.config.js ./tsconfig.json ./.env.development ./tailwind.config.js ./postcss.config.js ./start.sh ./ RUN npm ci COPY ./src ./src COPY ./public ./public @@ -23,10 +23,11 @@ WORKDIR /gen3 RUN addgroup --system --gid 1001 nextjs && \ adduser --system --uid 1001 nextjs USER nextjs +COPY --from=builder --chown=nextjs:nextjs /gen3/start.sh ./ COPY --from=builder --chown=nextjs:nextjs /gen3/config ./config COPY --from=builder --chown=nextjs:nextjs /gen3/public ./public COPY --from=builder --chown=nextjs:nextjs /gen3/.next/standalone ./ COPY --from=builder --chown=nextjs:nextjs /gen3/.next/static ./.next/static ENV PORT=3000 -CMD ["node", "server.js"] +CMD bash ./start.sh diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..debcc76 --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e +echo "starting server" +node server.js