Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .ebextensions_dev/00-makeFiles.config
Original file line number Diff line number Diff line change
@@ -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
killalljava
java -Dfile.encoding=UTF-8 -jar $JAR_PATH
3 changes: 3 additions & 0 deletions .ebextensions_dev/01-setTimeZone.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
commands:
set_time_zone:
command: ln -f -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
2 changes: 1 addition & 1 deletion .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build: # job 이름
runs-on: ubuntu-latest # OS환경
# PR이 merge되었고, 'dev' 브랜치일 경우 수행 (조건)
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev'
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop'

steps:
- name: Checkout
Expand Down
2 changes: 2 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions .platform/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
1 change: 1 addition & 0 deletions .platform/nginx/conf.d/client_max_body_size.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client_max_body_size 100M;
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: appstart
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ tasks.named('test') {
useJUnitPlatform()
}

jar{
enabled = false
}

12 changes: 12 additions & 0 deletions src/main/java/com/example/web/controller/RootController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.example.web.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RootController {
@GetMapping("/health")
public String healthCheck() {
return "I'm healthy!";
}
}
9 changes: 9 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
spring:
application:
name : beanstalk

datasource:
url: ${DATABASE_URL}
username: ${DATABASE_USERNAME}
Expand All @@ -18,6 +21,12 @@ spring:
auto: update
default_batch_fetch_size: 1000

servlet:
multipart:
enabled: true
max-file-size: 100MB
max-request-size: 300MB

springdoc:
swagger-ui:
path: /swagger
Expand Down