update
This commit is contained in:
parent
ed8a3918bb
commit
faae06defb
|
|
@ -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-asuransi-aman:dev .
|
||||
- docker push 103.82.242.92:8900/medols/web-asuransi-aman: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-asuransi-aman/build?token=autodeploymedols
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
# Menggunakan image Node.js yang lebih ringan
|
||||
FROM node:23.5.0-alpine
|
||||
|
||||
# Mengatur port
|
||||
ENV PORT 3000
|
||||
|
||||
# RUN npm install --force
|
||||
RUN npm install --legacy-peer-deps
|
||||
RUN npm install
|
||||
|
||||
# Membuat direktori aplikasi dan mengatur sebagai working directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Menyalin file penting terlebih dahulu untuk caching
|
||||
COPY package.json ./
|
||||
|
||||
# Menyalin direktori ckeditor5 jika diperlukan
|
||||
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
||||
|
||||
# Menyalin env
|
||||
COPY .env .env
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
# RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Menyalin source code aplikasi
|
||||
COPY . .
|
||||
|
||||
# Build aplikasi
|
||||
RUN npm run build
|
||||
# RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm next build
|
||||
|
||||
# Expose port untuk server
|
||||
EXPOSE 3000
|
||||
|
||||
# Perintah untuk menjalankan aplikasi
|
||||
CMD ["npm" "run" "start"]
|
||||
Loading…
Reference in New Issue