This commit is contained in:
Anang Yusman 2025-07-13 16:31:19 +08:00
parent 9116abc611
commit 7cdea969f8
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/jaecoo/web-jaecoo-bandung:dev .
- docker push 103.82.242.92:8900/jaecoo/web-jaecoo-bandung: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/autodeploy-jaecoo/build?token=autodeployjaecoo

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 -g npm@latest
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"