From b9ed439cbae9111e798d978d03dd5a78d3869d1d Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Tue, 1 Jul 2025 17:22:33 +0900 Subject: [PATCH] Add `internal_frontend` module with CI pipeline and Docker configuration --- .gitlab-ci-template.yml | 2 ++ .gitlab-ci.yml | 1 + docker-compose.yml | 9 +++++++++ internal_frontend/.gitlab-ci.yml | 30 ++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 internal_frontend/.gitlab-ci.yml diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml index 89722a3..897448a 100644 --- a/.gitlab-ci-template.yml +++ b/.gitlab-ci-template.yml @@ -126,6 +126,7 @@ echo " gateway : $(cat digest-gateway.txt)" echo " server : $(cat digest-server.txt)" echo " frontend : $(cat digest-frontend.txt)" + echo " frontend : $(cat digest-internal_frontend.txt)" echo "Injecting image digests" cp docker-compose.yml docker-compose.generated.yml @@ -133,6 +134,7 @@ sed -i "s|registry.boomlab.party/rheinsw/rheinsw-mono-repo/gateway|registry.boomlab.party/rheinsw/rheinsw-mono-repo/gateway@$(cat digest-gateway.txt)|g" docker-compose.generated.yml sed -i "s|registry.boomlab.party/rheinsw/rheinsw-mono-repo/server|registry.boomlab.party/rheinsw/rheinsw-mono-repo/server@$(cat digest-server.txt)|g" docker-compose.generated.yml sed -i "s|registry.boomlab.party/rheinsw/rheinsw-mono-repo/frontend|registry.boomlab.party/rheinsw/rheinsw-mono-repo/frontend@$(cat digest-frontend.txt)|g" docker-compose.generated.yml + sed -i "s|registry.boomlab.party/rheinsw/rheinsw-mono-repo/internal_frontend|registry.boomlab.party/rheinsw/rheinsw-mono-repo/internal_frontend@$(cat digest-internal_frontend.txt)|g" docker-compose.generated.yml echo "Copying docker-compose.generated.yml to $HOST:$REMOTE_ENV_PATH/docker-compose.yml" # Ensure remote path exists before scp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 646ed8d..c6eebb4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ include: - local: '.gitlab-ci-template.yml' - local: 'backend/.gitlab-ci.yml' - local: 'frontend/.gitlab-ci.yml' + - local: 'internal_frontend/.gitlab-ci.yml' stages: - build diff --git a/docker-compose.yml b/docker-compose.yml index b0bad16..eec2cdb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,6 +26,15 @@ services: networks: - rheinsw-net + internal_frontend: + image: registry.boomlab.party/rheinsw/rheinsw-mono-repo/internal_frontend + container_name: internal_frontend + ports: + - "5101:3000" + restart: on-failure + networks: + - rheinsw-net + networks: rheinsw-net: driver: bridge diff --git a/internal_frontend/.gitlab-ci.yml b/internal_frontend/.gitlab-ci.yml new file mode 100644 index 0000000..72ae43b --- /dev/null +++ b/internal_frontend/.gitlab-ci.yml @@ -0,0 +1,30 @@ +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - node_modules/ + - .next/cache/ + +build_internal_frontend: + stage: build + image: node:22@sha256:f6b9c31ace05502dd98ef777aaa20464362435dcc5e312b0e213121dcf7d8b95 + script: + - | + cd internal_frontend + npm install + npx next build + artifacts: + paths: + - internal_frontend/.next + - internal_frontend/public + - internal_frontend/package.json + - internal_frontend/package-lock.json + expire_in: 1 hour + +docker_internal_frontend: + extends: .docker-build-template + variables: + IMAGE_NAME: internal_frontend + WORKDIR_PATH: internal_frontend + DOCKERFILE_PATH: Dockerfile + needs: + - build_internal_frontend