diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 623f5d8b..4a0ee50e 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -6,6 +6,7 @@ on: - main - dev - dev-be + - load-test jobs: build_and_deploy: runs-on: ubuntu-latest diff --git a/docker-compose.yml b/docker-compose.yml index af23487f..375417f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ services: - server: + server_1: build: context: . dockerfile: dockerfile-server @@ -8,7 +8,46 @@ services: env_file: - .env ports: - - "3000:3000" + - "3001:3000" + networks: + - app-network + + server_2: + build: + context: . + dockerfile: dockerfile-server + image: seunggwan/corinee-server + restart: always + env_file: + - .env + ports: + - "3002:3000" + networks: + - app-network + + server_3: + build: + context: . + dockerfile: dockerfile-server + image: seunggwan/corinee-server + restart: always + env_file: + - .env + ports: + - "3003:3000" + networks: + - app-network + + server_4: + build: + context: . + dockerfile: dockerfile-server + image: seunggwan/corinee-server + restart: always + env_file: + - .env + ports: + - "3004:3000" networks: - app-network @@ -24,7 +63,10 @@ services: ports: - "80:80" depends_on: - - server + - server_1 + - server_2 + - server_3 + - server_4 volumes: - /etc/letsencrypt/live/corinee.site:/etc/letsencrypt/live/corinee.site - /etc/letsencrypt/live/corinee.site/fullchain.pem:/etc/letsencrypt/live/corinee.site/fullchain.pem diff --git a/nginx.conf b/nginx.conf index 57e7f456..ce5934db 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,4 +1,3 @@ -#nginx.conf events { worker_connections 1024; } @@ -7,6 +6,13 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; + upstream backend { + server server_1:3000; + server server_2:3000; + server server_3:3000; + server server_4:3000; + } + server { listen 80; listen 443 ssl; @@ -25,7 +31,7 @@ http { # server 서비스로 프록시 (API 요청을 server로 전달) location /api { - proxy_pass http://server:3000; + proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; diff --git a/yarn.lock b/yarn.lock index 5be556a5..48c9302c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2351,6 +2351,15 @@ __metadata: languageName: node linkType: hard +"@types/jsonwebtoken@npm:^9": + version: 9.0.7 + resolution: "@types/jsonwebtoken@npm:9.0.7" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/e1cd0e48fcae21b1d4378887a23453bd7212b480a131b11bcda2cdeb0687d03c9646ee5ba592e04cfaf76f7cc80f179950e627cdb3ebc90a5923bce49a35631a + languageName: node + linkType: hard + "@types/keyv@npm:^3.1.4": version: 3.1.4 resolution: "@types/keyv@npm:3.1.4" @@ -6996,7 +7005,7 @@ __metadata: languageName: node linkType: hard -"jsonwebtoken@npm:9.0.2": +"jsonwebtoken@npm:9.0.2, jsonwebtoken@npm:^9.0.2": version: 9.0.2 resolution: "jsonwebtoken@npm:9.0.2" dependencies: @@ -9161,6 +9170,7 @@ __metadata: "@types/express": "npm:^5.0.0" "@types/jest": "npm:^29.5.2" "@types/js-yaml": "npm:^4" + "@types/jsonwebtoken": "npm:^9" "@types/node": "npm:^20.3.1" "@types/passport": "npm:^0" "@types/passport-google-oauth20": "npm:^2" @@ -9185,6 +9195,7 @@ __metadata: ioredis: "npm:^5.4.1" jest: "npm:^29.5.0" js-yaml: "npm:^4.1.0" + jsonwebtoken: "npm:^9.0.2" mysql2: "npm:^3.11.3" nest-winston: "npm:1.9.7" passport: "npm:^0.7.0"