From d9435712863922016ba3df6321761a12a2b8a7bc Mon Sep 17 00:00:00 2001 From: youngho kim Date: Fri, 4 Jul 2025 16:10:44 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20elastic=20beanstalk=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ebextensions_dev/00-makeFiles.config | 12 ++++ .ebextensions_dev/01-set-timezone.config | 3 + .github/workflows/dev_deploy.yml | 6 +- .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/8.14.2/fileHashes/fileHashes.bin | Bin 35247 -> 35247 bytes .gradle/8.14.2/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/file-system.probe | Bin 8 -> 8 bytes .../nginx/conf.d/client_max_body_size.conf | 1 + .platform/nginx/nginx.conf | 63 ++++++++++++++++++ Procfile | 1 + build.gradle | 4 ++ src/main/resources/application.yml | 11 ++- 13 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 .ebextensions_dev/00-makeFiles.config create mode 100644 .ebextensions_dev/01-set-timezone.config create mode 100644 .platform/nginx/conf.d/client_max_body_size.conf create mode 100644 .platform/nginx/nginx.conf create mode 100644 Procfile diff --git a/.ebextensions_dev/00-makeFiles.config b/.ebextensions_dev/00-makeFiles.config new file mode 100644 index 0000000..ac43e12 --- /dev/null +++ b/.ebextensions_dev/00-makeFiles.config @@ -0,0 +1,12 @@ +files: + "/sbin/appstart": + mode: "000755" + owner: webapp + group: webapp + content: | + #!/usr/bin/env bash + JAR_PATH=/var/app/current/application.jar + + # run app + killall java + java -Dfile.encoding=UTF-8 -jar $JAR_PATH \ No newline at end of file diff --git a/.ebextensions_dev/01-set-timezone.config b/.ebextensions_dev/01-set-timezone.config new file mode 100644 index 0000000..4249da0 --- /dev/null +++ b/.ebextensions_dev/01-set-timezone.config @@ -0,0 +1,3 @@ +commands: + set_time_zone: + command: ln -f -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime \ No newline at end of file diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 6d30121..1fce3c2 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -44,7 +44,7 @@ jobs: mkdir -p deploy cp build/libs/*.jar deploy/application.jar cp Procfile deploy/Procfile - cp -r .ebextensions-dev deploy/.ebextensions + cp -r .ebextensions_dev deploy/.ebextensions cp -r .platform deploy/.platform cd deploy && zip -r deploy.zip . @@ -53,8 +53,8 @@ jobs: with: aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }} aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }} - application_name: breifing-dev - environment_name: Breifing-dev-env + application_name: workbook2-dev + environment_name: workbook2-dev-env version_label: github-action-${{ steps.current-time.outputs.formattedTime }} region: ap-northeast-1 deployment_package: deploy/deploy.zip diff --git a/.gradle/8.14.2/executionHistory/executionHistory.lock b/.gradle/8.14.2/executionHistory/executionHistory.lock index f71aa0f53e1a40d78fb2f8545cd87b2dd3620823..3170912ff768e89f5ec9819991df0b67906a4d6f 100644 GIT binary patch literal 17 UcmZQByS(OX)!NI|3=nV#076U!{Qv*} literal 17 UcmZQByS(OX)!NI|3=nVt076Oy`v3p{ diff --git a/.gradle/8.14.2/fileHashes/fileHashes.bin b/.gradle/8.14.2/fileHashes/fileHashes.bin index 00480cc38f8d90a104702b7d3a9e9ca14cda0267..3e42e2f5a02c287feaacf34380ee17209e22176f 100644 GIT binary patch delta 719 zcmXBSO-NKx6bEqUH4ZrxIgDZ$3T_G&r@*3xi)kksG1Tah!4?*kNI?i9inXwN&UvffJNKS@&f#7cmJ3Uj+un~} zmBD4ZQa9R1E%WCt>hO)n9@1;9v^j(sG{zXS$O{(qznI@gYpp18LWBsK1lMp&VB@7A zhE*qYY`KtIE#l8Vho{jXs^dXQ?8JpQpO8TpLq+vueC!CV^`NSg*KQ*s7{UXF@<9vy z*c6;VMS?b~pl(TAx4g@RybsgeAwmg03yz~W$&mmq3TluvFlil_O469BABPP01v+}T z{98;2QdkmXaUgiF>w8O!soDEFeD^1{t!i;*fRAiKY~Y!xpZkJsj=0ZJbC2rhwh%Qi zY3mplY+zCF4Zj4tIF;f(`?!+g)_PIkh`NIx24=E4ln-*PQQbVq<=r)$9p=zE#0BR8 zK{MV7TJdS95`lCXol%9_G&gmKc1GT#pQPW=D^Lz1BMvpZ20g-?zGGAH8x^A**+Gk7 zAHxPFs|)iS$)CnoiQLqIu`FFm?hmFO?h*cCBE#ctV~L>}a3Bby{?Q&inGJa|MK-P` Xg8I^UpNASQ!>cS$e^PH{KUn_(KUpt9 delta 719 zcmXBSTS(JU90%}ion%m3-~|8aije9vVVx?$)Z7h6fZ zeR>u4TT5t#b%~DsP3@wU$2+uKd+_Fjons>^Yyz8cOJXZsuo)JU*wE`@VnD0x4``$P8W^g^MBHu3ksP#kZ-d_$M$`iaNK5b^u`sJyH@Yke4`0%g!#> z^RNb5dEvW={Tv$_Mc)V58gG(BpXDj$WMw_pc@&bE>-NCHz}gxRknmtk!i%30!0IM3 zrV9s~M6@xCh>H3O-xw0n+1)5^=3}Od=)PvTyc^|S(Uyfn;w>QY7cT_VWyoGEfzh{; zBzwspl=>8sbl<;=lM+_i>6_rMK)r;T7CT8VJUay1!VWBS_zrRm>@3G&Ze^8%+J00^ ze1w;Qb@kyP1MAv^FS1fcjs76Jl!DqPh_uahRlN3}C>d1^_w{1p5F0 literal 17 VcmZQ}eRhRM>hRlN3}C<{4*)s}1oQv^ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index 9ded512fd26ffe5bb2728bb86c213ed6e01a3a86..415df5844923b60f7f587af98b439700744be3aa 100644 GIT binary patch literal 8 PcmZQzV4Qx1_0%Z<2)+Xb literal 8 PcmZQzV4Qw(g-ss-2_pj3 diff --git a/.platform/nginx/conf.d/client_max_body_size.conf b/.platform/nginx/conf.d/client_max_body_size.conf new file mode 100644 index 0000000..8e8277e --- /dev/null +++ b/.platform/nginx/conf.d/client_max_body_size.conf @@ -0,0 +1 @@ +client_max_body_size 200M; \ No newline at end of file diff --git a/.platform/nginx/nginx.conf b/.platform/nginx/nginx.conf new file mode 100644 index 0000000..612092e --- /dev/null +++ b/.platform/nginx/nginx.conf @@ -0,0 +1,63 @@ +user nginx; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; +worker_processes auto; +worker_rlimit_nofile 33282; + +events { + use epoll; + worker_connections 1024; + multi_accept on; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + include conf.d/*.conf; + + map $http_upgrade $connection_upgrade { + default "upgrade"; + } + + upstream springboot { + server 127.0.0.1:8080; + keepalive 1024; + } + + server { + listen 80 default_server; + listen [::]:80 default_server; + + location / { + proxy_pass http://springboot; + # CORS 관련 헤더 추가 + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; + proxy_http_version 1.1; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Upgrade $http_upgrade; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + access_log /var/log/nginx/access.log main; + + client_header_timeout 60; + client_body_timeout 60; + keepalive_timeout 60; + gzip off; + gzip_comp_level 4; + + # Include the Elastic Beanstalk generated locations + include conf.d/elasticbeanstalk/healthd.conf; + } +} \ No newline at end of file diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..58dab8d --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: appstart \ No newline at end of file diff --git a/build.gradle b/build.gradle index a5f4f3d..64fff5c 100644 --- a/build.gradle +++ b/build.gradle @@ -38,3 +38,7 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +jar { + enabled = false +} \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 19b7f8c..f67d5bd 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -18,10 +18,19 @@ spring: auto: update # create update default_batch_fetch_size: 1000 + servlet: + multipart: + enabled: true + maxFileSize: 200MB + maxRequestSize: 300MB + + springdoc: api-docs: enabled: true swagger-ui: enabled: true path: /swagger-ui.html - override-with-generic-response: false \ No newline at end of file + override-with-generic-response: false + +