diff --git a/.gitlab-ci-template.yml b/.gitlab-ci-template.yml index 70fe6c4..a645d9e 100644 --- a/.gitlab-ci-template.yml +++ b/.gitlab-ci-template.yml @@ -26,6 +26,7 @@ if [ -n "$BUILD_FOLDER" ]; then BUILD_ARGS="$BUILD_ARGS --build-arg BUILD_FOLDER=$BUILD_FOLDER"; fi if [ -n "$IMAGE_NAME" ]; then BUILD_ARGS="$BUILD_ARGS --build-arg IMAGE_NAME=$IMAGE_NAME"; fi if [ -n "$MAIN_CLASS" ]; then BUILD_ARGS="$BUILD_ARGS --build-arg MAIN_CLASS=$MAIN_CLASS"; fi + docker build $BUILD_ARGS -t $DOCKER_IMAGE:$TAG -f $DOCKERFILE_PATH . if [[ "$TAG" == "dev" || "$TAG" == "production" || "$TAG" == "pipeline" ]]; then diff --git a/backend/package-lock.json b/backend/package-lock.json new file mode 100644 index 0000000..dfb18f1 --- /dev/null +++ b/backend/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "backend", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/docker-compose.yml b/docker-compose.yml index d752fc8..902fcef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: - "8080:8080" env_file: - ./gateway.env + restart: on-failure server: image: registry.boomlab.party/rheinsw/rheinsw-mono-repo/server @@ -14,11 +15,11 @@ services: - "8081:8081" env_file: - ./server.env + restart: on-failure frontend: image: registry.boomlab.party/rheinsw/rheinsw-mono-repo/frontend container_name: frontend - env_file: - - ./frontend.env ports: - "5100:3000" + restart: on-failure diff --git a/frontend/.gitlab-ci.yml b/frontend/.gitlab-ci.yml index ff7825d..6cfda49 100644 --- a/frontend/.gitlab-ci.yml +++ b/frontend/.gitlab-ci.yml @@ -10,8 +10,15 @@ build_frontend: script: - | cd frontend + echo "NEXT_PUBLIC_HCAPTCHA_SITE_KEY=$HCAPTCHA_SITE_KEY" > .env npm install npx next build + artifacts: + paths: + - frontend/.next + - frontend/public + - frontend/package.json + - frontend/package-lock.json docker_frontend: extends: .docker-build-template diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f89869b..c57f214 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,31 +1,25 @@ -# Use lightweight Node.js 20 base image -FROM node:20-alpine@sha256:9bef0ef1e268f60627da9ba7d7605e8831d5b56ad07487d24d1aa386336d1944 as builder - -# Set working directory -WORKDIR /app - -# Copy package files separately for better Docker caching -COPY package.json package-lock.json ./ - -# Install dependencies -RUN npm ci - -# Copy entire project -COPY . . - -# Build the Next.js app -RUN npm run build - -# Use a minimal base image for running the app +# Use a lightweight Node.js 20 Alpine image (digest-pinned for reproducibility) FROM node:20-alpine@sha256:9bef0ef1e268f60627da9ba7d7605e8831d5b56ad07487d24d1aa386336d1944 +# Set the working directory inside the container WORKDIR /app -# Copy built files from the builder stage -COPY --from=builder /app ./ +# Copy only the production-ready files built in CI +# These files must be passed as GitLab artifacts: +# - .next/ → built Next.js app +# - public/ → static assets +# - package.json → app manifest +# - package-lock.json → to lock dependencies for reproducibility +COPY .next .next +COPY public public +COPY package.json package.json +COPY package-lock.json package-lock.json -# Expose port +# Install only production dependencies to reduce image size +RUN npm ci --omit=dev + +# Expose the port that Next.js serves on (default is 3000) EXPOSE 3000 -# Start Next.js in production mode +# Start the Next.js app in production mode CMD ["npm", "run", "start"] diff --git a/frontend/app/(root)/Home.tsx b/frontend/app/(root)/Home.tsx new file mode 100644 index 0000000..3bb024a --- /dev/null +++ b/frontend/app/(root)/Home.tsx @@ -0,0 +1,45 @@ +'use client'; + +import React, {useEffect} from "react"; +import HomeServices from "@/app/(root)/sections/HomeServices"; +import {motion} from "framer-motion"; +import Hero from "@/app/(root)/sections/Hero"; +import About from "@/app/(root)/sections/About"; +import ProcessSection from "@/app/(root)/sections/ProcessSection"; +import WhyUs from "@/app/(root)/sections/WhyUs"; +import Faq from "@/app/(root)/sections/Faq"; +import ReferralSection from "@/app/(root)/sections/ReferralSection"; + +const Home = () => { + useEffect(() => { + const scrollToId = localStorage.getItem('scrollToId') + if (scrollToId) { + localStorage.removeItem('scrollToId') + const el = document.getElementById(scrollToId) + if (el) { + setTimeout(() => { + el.scrollIntoView({behavior: 'smooth', block: 'start'}) + }, 200) + } + } + }, []) + + return ( + + + + + + + + + + ); +}; + +export default Home; diff --git a/frontend/app/(root)/layout.tsx b/frontend/app/(root)/layout.tsx deleted file mode 100644 index 518d45e..0000000 --- a/frontend/app/(root)/layout.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import type {Metadata} from "next"; -import "../globals.css"; - -import Nav from "@/components/Navbar/Nav"; -import Footer from "@/components/Footer/Footer"; -import {ThemeProvider} from "@/components/provider/ThemeProvider"; -import React from "react"; -import {cookies} from "next/headers"; -import {themeColors} from "@/components/Helper/ThemeColors"; - -export const metadata: Metadata = { - title: "Rhein Software", - description: "Rhein Software Development", -}; - -export default async function RootLayout({ - children, - }: Readonly<{ - children: React.ReactNode; -}>) { - const cookieStore = await cookies(); - const theme = cookieStore.get("theme")?.value === "dark" ? "dark" : "light"; - const bgColor = themeColors[theme].primaryBg; - - return ( - - - - -