$ sudo -i
passwd ubuntu
New password: 패스워드 입력
Retype new password:
passwd: password updated successfully
apt-get update
apt-get install -y --no-install-recommends tzdata g++ git curl
apt-get install openjdk-11-jdk
자바버전 확인
java -version
javac -version
vim ~/.bashrc
i 입력으로 Insert
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
export PATH=$PATH:$JAVA_HOME/bin
esc누르고
:wq!입력해서 나가기
source ~/.bashrc
echo $JAVA_HOME
apt update
apt install software-properties-common
add-apt-repository ppa:deadsnakes/ppa
cd /usr/local/bin
apt-get install -y python3-pip
ln -s /usr/bin/pip3 pip
pip3 install --upgrade pip
apt-get clean
apt-get install nginx
systemctl start nginx
chmod 775 /etc/nginx/sites-available
cd /etc/nginx/sites-available
vim api
i 입력
server{
server_name 도메인;
location / {
include proxy_params;
proxy_pass http://127.0.0.1:8000;
}
}
esc
:wq!
enter
ln -s /etc/nginx/sites-available/api /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx
cd /var/www/
경로를 모르겠으면
find / -name 폴더명 -type d
git clone https://github.com/gangsanlee2/hello_amazon.git
cd hello_amazon
pip install fastapi uvicorn
nohup python3 main.py & python3 -m uvicorn main:app --reload
안되면nohup python3 main.py python3 -m uvicorn main:app --reload
docker compose up은 했나 생각해보자
- requirements.txt가 있는 디렉토리에서 백날 pip 해봐야 aws에는 안올라가지
먼저 docker-compose파일이 있는 경로에서 compose up 실행하고 그 다음에 다시python3 -m uvicorn main:app --reload