Connect to console
Start Instance
Start setting
Amazon Machine Image
인스턴스 유형
key pair
탄력적 IP 주소 할당
탄력적 IP 주소 연결
확인
Vs Code : Remote-SSH
Install and start docker
sudo yum update
# Install docker
sudo yum install docker
# Install docker-compose
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
# Fix permissions
sudo chmod +x /usr/local/bin/docker-compose
# Create symbolic link
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
# Add user to group so we can use commands without sudo
# (+ Login again, to apply changes)
sudo usermod -a -G docker ec2-user
# Start docker
sudo service docker start
# Verify the installation
docker -v
docker-compose -v
Install nvm, Nodejs and Yarn
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
# Activate nvm
. ~/.nvm/nvm.sh
#Install Node.js
nvm install --lts
# Install yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
# Reload the bash profile
source ~/.bashrc
Install git
# Install git
sudo yum install -y git
sample app
Clone your repo
git clone <link-to-your-repo>
## e.g git clone --recursive https://github.com/litsynp/docker-example.git
cd frontend
yarn
환경 변수 및 시크릿 설정
IP setting (sample app 기준)
docker-compose -f docker-compose.prod.yml up -d --build
docker-compose exec backend python manage.py migrate
--> AWS Route 53으로 도메인 생성 후 연결
--> 로드밸런스 생성 후 도메인 연결 및 HTTPS 적용(27) 부터 보면 됨