This commit is contained in:
Anang Yusman 2025-07-14 16:01:36 +08:00
parent 74b27f9341
commit 76dc0b74e6
2 changed files with 53 additions and 0 deletions

29
.gitlab-ci.yml Normal file
View File

@ -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/medols/web-jaecoo:dev .
- docker push 103.82.242.92:8900/medols/web-jaecoo: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-jaecoo/build?token=autodeployjaecookelapagading

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM node:21-alpine
ENV PORT 4000
# 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 --legacy-peer-deps
RUN npm install
# Copying source files
COPY . /usr/src/app
# Building app
RUN npm run build
EXPOSE 4000
# Running the app
CMD "npm" "run" "start"