From 2dad778d0eb4cd0e5ce1fafb976f7ea60b156300 Mon Sep 17 00:00:00 2001 From: theoleuthardt Date: Fri, 28 Feb 2025 11:47:55 +0100 Subject: [PATCH] feat: debug print at nextjs container start --- .github/workflows/deploy.yml | 2 +- frontend/Dockerfile | 9 +++++---- frontend/entrypoint.sh | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 frontend/entrypoint.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1250eea..a0ed3d1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,7 +49,7 @@ jobs: push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/werkzeugkiste-backend:latest build-args: | - CORS_ALLOWED_ORIGIN=${{ secrets.CORS_ALLOWED_ORIGIN }} + CORS_ALLOWED_ORIGIN=${{ secrets.CORS_ALLOWED_ORIGIN }} deploy-on-server: needs: docker-build-push diff --git a/frontend/Dockerfile b/frontend/Dockerfile index dc4130c..f2affb9 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -60,8 +60,9 @@ USER nextjs EXPOSE 3000 ENV PORT=3000 - -# server.js is created by next build from the standalone output -# https://nextjs.org/docs/pages/api-reference/config/next-config-js/output ENV HOSTNAME="0.0.0.0" -CMD ["node", "server.js"] \ No newline at end of file + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/frontend/entrypoint.sh b/frontend/entrypoint.sh new file mode 100644 index 0000000..e3ec2e8 --- /dev/null +++ b/frontend/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "NEXT_PUBLIC_BACKEND_URL: $NEXT_PUBLIC_BACKEND_URL" +exec node server.js