deploy
This commit is contained in:
parent
9116abc611
commit
7cdea969f8
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
Loading…
Reference in New Issue