Vite + Vue 사용 안함
📗Vite + Vue 3.0
Vite와 Vue로 프로젝트를 생성하자
npm init vite-app <project name>
그 이후
npm install
npm run dev
명령어로 실행을 확인하자
화면을 확인했으니 실서버에 올려보자!
🐋Dockerfile 작성 후 hub 올리기
FROM node:slim
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . /app
CMD [ "npm", "run", "dev"]
FROM node:slim
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . /app
CMD [ "npm", "run", "dev"]
Dockerfile
과
node_modules
package-lock.json
.dockerignore
파일을 작성한 후
docker build -t ililil9482/jayeon-vue:1.0 .
docker push ililil9482/jayeon-vue:1.0
hub에 푸시했다.
✅Nginx 수정
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name jayeonapple.com;
location / {
proxy_pass http://jayeon:3000;
}
}
server {
listen 80;
server_name juno.jayeonapple.com;
location / {
proxy_pass http://portfolio:3000;
}
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
}
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name jayeonapple.com;
location / {
proxy_pass http://jayeon:3000;
}
}
server {
listen 80;
server_name juno.jayeonapple.com;
location / {
proxy_pass http://portfolio:3000;
}
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
}
nginx.conf
파일을 다음과 같이 수정한다.
nginx 이미지를 다시 build 후 컨테이너를 종료 후 다시 실행하자!
🤵♂️jenkins 설정 변경
pipeline {
agent any
stages {
stage('Down') {
steps {
sshPublisher(publishers: [
sshPublisherDesc(configName: 'aws',
transfers: [
sshTransfer(cleanRemote: false,
excludes: '',
execCommand: 'cd /project/jayeon && sudo docker-compose down',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '',
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: '')
],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false)
])
}
}
stage('Pull') {
steps {
sshPublisher(publishers: [
sshPublisherDesc(configName: 'aws',
transfers: [
sshTransfer(cleanRemote: false,
excludes: '',
execCommand: 'sudo docker pull ililil9482/jayeon-vue:1.0',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '',
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: '')
],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false)
])
}
}
stage('Up') {
steps {
sshPublisher(publishers: [
sshPublisherDesc(configName: 'aws',
transfers: [
sshTransfer(cleanRemote: false,
excludes: '',
execCommand: 'cd /project/jayeon && sudo docker-compose up -d',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '',
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: '')
],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false)
])
}
}
}
}
pipeline {
agent any
stages {
stage('Down') {
steps {
sshPublisher(publishers: [
sshPublisherDesc(configName: 'aws',
transfers: [
sshTransfer(cleanRemote: false,
excludes: '',
execCommand: 'cd /project/jayeon && sudo docker-compose down',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '',
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: '')
],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false)
])
}
}
stage('Pull') {
steps {
sshPublisher(publishers: [
sshPublisherDesc(configName: 'aws',
transfers: [
sshTransfer(cleanRemote: false,
excludes: '',
execCommand: 'sudo docker pull ililil9482/jayeon-vue:1.0',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '',
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: '')
],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false)
])
}
}
stage('Up') {
steps {
sshPublisher(publishers: [
sshPublisherDesc(configName: 'aws',
transfers: [
sshTransfer(cleanRemote: false,
excludes: '',
execCommand: 'cd /project/jayeon && sudo docker-compose up -d',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '',
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: '')
],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false)
])
}
}
}
}
모두 잘 연결된 것을 확인했다.
Author And Source
이 문제에 관하여(Vite + Vue 사용 안함), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@ililil9482/Vue-프로젝트-생성저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)