ํ์๋ํ๊ต Keyword Based Short URL ์๋น์ค
-
Ubuntu 18.04 LTS (GNU/Linux)
-
Python >= 3.7
๊ด๋ฆฌ์ ๊ธฐ๋ฅ ๊ฐ๋ฐ ์ @auth.login_required
๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ์ฃผ์ ์ฒ๋ฆฌ ํด์ผ๋ ์๋ ์์ต๋๋ค. (์ฐธ๊ณ !)
Based on Mac OSX Mojave
# Installation Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
# Pipenv Installation
brew install python3
brew reinstall python3 #python3๋ฅผ ์์ ์ ์ค์นํ๊ฑฐ๋ pip ์
๊ทธ๋ ์ด๋๋ฅผ ํ์ง ์๊ฐ์ด ์ง๋ ๊ฒฝ์ฐ
pip3 install pip --upgrade
pip3 --version
pip3 install pipenv
pipenv --version
# Yarn Install
brew install yarn
# Pipenv Package Install & Virutal Env Activate
cd {SOURCE_PATH}
pipenv install
# docker-compose.yaml
docker-compose up -d
# .env ๊ฐ๋ฐํ๊ฒฝ์ฉ ์ค์
# Flask Running
pipenv shell
# Flask DB
python manage.py db init
python manage.py db upgrade
python manage.py db migrate
Based on Ubuntu 18.04 LTS
# ํ์ ์ ํธ๋ฆฌํฐ ์ค์น
sudo apt-get update
sudo apt install build-essential libssl-dev libffi-dev python3-setuptools
sudo apt install libmysqlclient-dev
# Python PIP + Pipenv install
sudo apt install python3-pip
pip3 --version # PIP ์ค์น ํ์ธ
pip3 install --user pipenv # PIPENV ์ค์น
export PATH="$HOME/.local/bin:$PATH"
# Python 3.7 Install
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7 python3.7-dev
sudo ln -sfn /usr/bin/python3.7 /usr/bin/python
# Nginx install
sudo apt install nginx
# Yarn install
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt install yarn
yarn --version # Yarn ์ค์น ํ์ธ
# Source install
cd ~/
git clone {SOURCE_URL}
cd {$PROJECT_ROOT}
# Python + Yarn Package Install
pipenv install
cd app
yarn install
yarn build
# Supervisor Settings
sudo apt install supervisor
cd /etc/supervisor/conf.d/
sudo vi hypass.conf # config/supervisor/conf.d/hypass.conf ์ฐธ์กฐ
# Nginx Settings
cd /etc/nginx/sites-available
sudo vi default # config/nginx/conf.d/hypass.conf ์ฐธ์กฐ
# Supervisor Applying
sudo supervisorctl reread
sudo service supervisor restart
sudo service nginx restart
# .env ๊ฐ ์ค์ (.env.example์ ์ฐธ์กฐ)
# Flask DB
python manage.py db init
python manage.py db upgrade
python manage.py db migrate
## Cerbot + Let's Encrypt
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python-certbot-nginx
# ๋ฐฉํ๋ฒฝ 443 port ์คํ ํ์!
sudo certbot --nginx # Certbot Setup
sudo service supervisor restart
sudo service nginx restart