Skip to content
Open
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
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

49 changes: 0 additions & 49 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/prettier.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/sprint4.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

15 changes: 15 additions & 0 deletions infra/ec2/ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
apps: [
{
name: 'spirnt-mission-server', // 프로세스 이름
script: './src/server.ts', // 실행 파일 경로
interpreter: 'bun', // 사용할 런타임
watch: false, // 파일 변경 시 자동 재시작 여부
env: {
// 환경 변수 설정
NODE_ENV: 'production',
PORT: 3000,
},
},
],
};
24 changes: 24 additions & 0 deletions infra/ec2/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
server {
listen 80;
listen [::]:80;


server_name _;

location / {
# 80번 포트로 들어온 요청을 내부의 3000번 포트(Bun/Express)로 전달
proxy_pass http://localhost:3000;

# 리버스 프록시를 위한 필수 헤더 설정
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;

# 실제 클라이언트 IP를 백엔드 서버에 전달
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Binary file added infra/ec2/secure-group-inbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added infra/ec2/secure-group-outbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions infra/ec2/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 패키지 목록 업데이트 및 unzip 설치
sudo apt update
sudo apt install unzip -y

# Bun 런타임 설치
curl -fsSL https://bun.sh/install | bash

# 환경 변수 즉시 적용
source ~/.bashrc

# PM2 전역 설치
npm install pm2 -g

# 프로젝트 폴더로 이동 (사용자 환경에 맞게 수정)
cd ~/7-sprint-mission/src

# Bun을 사용하여 서버 실행
pm2 start server.ts --interpreter bun --name "spirnt-mission-server"

# 실행 상태 및 실시간 로그 확인
pm2 list
pm2 logs mission-server

# 서버 재부팅 시 PM2 자동 시작 설정 (출력되는 sudo 명령어를 반드시 실행해야 함)
pm2 startup

# 현재 실행 중인 프로세스 목록을 '부팅 시 실행 목록'에 저장
pm2 save
Binary file added infra/rds/secure-group-inbound.png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added infra/rds/secure-group-outbound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added infra/s3/policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading