Skip to content

Commit

Permalink
add start (#10)
Browse files Browse the repository at this point in the history
* add start

* update Docker file, add start.sh
  • Loading branch information
craigrbarnes authored Dec 11, 2024
1 parent db9ac7d commit a23d460
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Check warning on line 33 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Image and Push to Quay / Build Image and Push

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
5 changes: 5 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e
echo "starting server"
node server.js

0 comments on commit a23d460

Please sign in to comment.