-
Notifications
You must be signed in to change notification settings - Fork 16
[김찬호] Sprint 8 #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 김찬호
Are you sure you want to change the base?
[김찬호] Sprint 8 #115
Conversation
@Component | ||
public class S3BinaryContentStorage implements BinaryContentStorage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3. 환경변수로 관리하기 위한 처리가 추가로 필요합니다!
@ConditionalOnProperty(name = "discodeit.storage.type", havingValue = "s3")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p1. 이 정보는 보안사항이라 절대 github에 올라가면 안되는 데이터입니다!
|
요구사항
기본
애플리케이션 컨테이너화
Dockerfile 작성
이미지 빌드 및 실행 테스트
Docker Compose 구성
BinaryContentStorage 고도화 (AWS S3)
AWS S3 버킷 구성
AWS S3 접근을 위한 IAM 구성
AWS S3 테스트
S3 API를 간단하게 테스트하세요.
패키지명: com.sprint.mission.discodeit.stoarge.s3
클래스명: AWSS3Test
AWS S3를 활용한 BinaryContentStroage 고도화
앞서 작성한 테스트 메소드를 참고해 S3BinaryContentStorage를 구현하세요.
클래스 다이어그램
AWS를 활용한 배포 (AWS RDS, ECR, ECS)
AWS RDS 구성
과금이 발생할 수 있으니 다음 항목은 한번 더 확인해주세요.
SSH 터널링을 통해 개발 환경에서 접근할 수 있도록 EC2를 구성하세요.
보안 그룹에서 인바운드 규칙을 편집하세요.
유형: SSH
소스: 내 IP
DataGrip을 통해 연결 후 데이터베이스와 사용자, 테이블을 초기화하세요.
AWS ECR 구성
이미지를 배포할 퍼블릭 레포지토리(discodeit)를 생성하세요.
프라이빗 레포지토리는 용량 제한이 있으므로 퍼블릭 레포지토리로 생성합니다.
aws configure 실행 후 앞서 생성한 discodeit IAM 사용자 정보를 입력하세요.
엑세스 키
시크릿 키
region: ap-northeast-2
output format: json
Docker 클라이언트를 배포할 레지스트리에 대해 인증합니다.
AWS 콘솔을 통해 생성한 레포지토리 페이지로 이동 후 우측 상단 푸시 명령 보기를 클릭하면 관련 명령어를 확인할 수 있습니다.
멀티플랫폼을 지원하도록 애플리케이션 이미지를 빌드하고, discodeit 레포지토리에 push 하세요.
AWS 콘솔에서 푸시된 이미지를 확인하세요.
AWS ECS 구성
배포 환경에서 컨테이너 실행 간 사용할 환경 변수를 정의하고, S3에 업로드하세요.
이외 설정은 기본값을 유지하세요.
태스크의 EC2 보안 그룹의 인바운드 규칙을 설정하여 어디서든 접근할 수 있도록 하세요.
심화
주요 변경사항
스크린샷
멘토에게