diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..b9c0e9c6 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +stages: + - build + - deploy + +build-dev: + stage: build + when: on_success + only: + - main + image: docker:stable + services: + - name: docker:dind + command: ["--insecure-registry=103.82.242.92:8900"] + script: + - docker logout + - docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN 103.82.242.92:8900 + - docker build -t 103.82.242.92:8900/mediahub/new-mediahub-fe:dev . + - docker push 103.82.242.92:8900/mediahub/new-mediahub-fe:dev + +auto-deploy: + stage: deploy + when: on_success + only: + - main + image: curlimages/curl:latest + services: + - docker:dind + script: + - curl --user admin:$JENKINS_PWD http://38.47.180.165:8080/job/auto-deploy-new-mediahub-fe/build?token=autodeploynewmediahub diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..13b638c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM node:21-alpine + +ENV PORT 3000 + +# Create app directory +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +# Installing dependencies +COPY package*.json /usr/src/app/ + +# RUN npm install --force +RUN npm install -g npm@latest +RUN npm install next --legacy-peer-deps + +# Copying source files +COPY . /usr/src/app + +# Building app +RUN npm run build +EXPOSE 3000 + +# Running the app +CMD "npm" "run" "start" diff --git a/app/(root)/page.tsx b/app/(root)/page.tsx deleted file mode 100644 index 5c618e91..00000000 --- a/app/(root)/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -const page = () => { - return