[박재성] sprint10#80
Merged
O-Seonsik merged 11 commits intoOct 14, 2025
Hidden character warning
The head ref may contain hidden characters: "\ubc15\uc7ac\uc131-sprint10"
Merged
Conversation
ae6f6b6 to
3b45774
Compare
3b45774 to
139313e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 요구사항
🎯 기본 요구사항
.env파일에 NODE_ENV, AWS_S3, AWS_RDS, JWT 등 프로덕션 환경 변수 설정lib/constants.ts를 통한 환경 변수 중앙 관리🎨 AWS S3 적용
AWS S3 버킷을 생성하고, 퍼블릭 액세스를 허용해 주세요.
일반 사용자가 S3 업로드된 파일에 접근할 수 있도록 S3 버킷 정책을 설정해 주세요.
s3:GetObject액션을 퍼블릭으로 허용AWS EC2에서 AWS S3를 사용하기 위한 액세스 키를 AWS IAM에서 발급하세요.
s3:GetObject,s3:PutObject만 부여프로덕션 환경에서는 파일 업로드에 AWS S3를 사용하도록 구현을 수정해 주세요.
🗄️ AWS RDS 적용
AWS RDS 프리티어에 해당하는 인스턴스를 생성합니다.
RDS 인스턴스에 대한 보안 그룹을 설정합니다.
프로덕션 환경에서는 Prisma에 프로젝트 데이터베이스와 연결하도록 합니다.
🖥️ AWS EC2에 Express 서버 배포하기
AWS EC2 프리티어에 해당하는 인스턴스를 생성합니다.
SSH를 사용해 EC2 인스턴스에 접속해 Express 서버를 배포해 주세요.
start.sh파일을 통한 자동화된 서버 배포🚀 심화 요구사항
⚡ EC2 인스턴스에서 pm2 프로세스 매니저를 사용하여 애플리케이션을 실행해 주세요.
PM2 프로세스 관리 및 모니터링
PM2 설정 파일 구성 (
ecosystem.config.js)🌐 EC2 인스턴스에서 nginx 리버스 프록시를 설정해 서버를 80번 포트로 서비스합니다.
Nginx 리버스 프록시 설정
Nginx 설정 파일 구성
/etc/nginx/default.d/경로에 프록시 설정 파일 생성proxy_pass를 통한 Express 애플리케이션 연결✨ 주요 변경사항
📁 infra 폴더 생성
s3폴더에 버킷 정책 설정 스크린샷을 저장했습니다.rds폴더에 RDS 인스턴스의 보안 그룹 설정 스크린샷들을 저장했습니다.ec2폴더에 EC2 인스턴스의 보안 그룹 설정 스크린샷들을 저장했습니다.ec2폴더에start.sh,ecosystem.config.js,nginx.conf를 저장했습니다.🚀 s3 이미지 업로드 구현
Cloudinary에서 AWS S3로 전환
src/utils/cloudinary.ts→src/utils/s3.ts로 유틸리티 변경src/controllers/imageController.ts에서 S3 업로드 로직 구현multer 및 aws sdk 활용
multer.memoryStorage())@aws-sdk/client-s3패키지를 통한 S3 연동src/types/s3Types.ts분리API 엔드포인트 주소
http://54.180.106.172/