Skip to content
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

[Deploy]서버에서 서빙하기 #83

Open
jangdonghae opened this issue Dec 5, 2019 · 5 comments
Open

[Deploy]서버에서 서빙하기 #83

jangdonghae opened this issue Dec 5, 2019 · 5 comments
Assignees
Labels
Backend Setting Set up for the server

Comments

@jangdonghae
Copy link
Contributor

jangdonghae commented Dec 5, 2019

시작하기 전에 가상환경 활성화:

$ source triplannet/bin/activate

Backend:

$ python manage.py check --deploy (deploy 하기 전에 checking 해야할 list 띄워줌)

/backend/triplannet 폴더에서 다음 명령어를 쳐주시면 됩니다. @dreamsh19

$ uwsgi --http :8000 --wsgi-file /home/swpp-team6/swpp2019-team6/backend/triplannet/triplannet/wsgi/deploy.py 

Frontend:

$ sudo npm run build --prod (이 명령어는 frontend 변경 사항 있을 때 하시면 될 것 같습니다)
$ sudo service nginx start
$ sudo yarn start (꼭 필요한 것은 아닌 듯)

mysql 설정

Repo를 clone 받으면 /backend/triplannet/.config/setting_deploy.json에서 설정해야합니다.

@deploy-soon
Copy link
Contributor

Before deploy the service

$ sudo apt-get update
$ sudo apt-get install python3-venv
$ python3 -m venv ./triplannet
$ git clone https://github.com/swsnu/swpp2019-team6.git
$ sudo apt-get install mysql-server mysql-client

@dreamsh19
Copy link
Contributor

Deactivate nginx

$ sudo service nginx stop

@jangdonghae
Copy link
Contributor Author

로컬에서 돌리시고 싶으신 분은 순용님이 올리신 mysql 관련 된 것들 깔아주셔야 합니다!
python3-dev, mysql-server, mysql-client 등등 깔아야 할게 많은데 하다가 안되시면 물어봐주세요

@deploy-soon
Copy link
Contributor

Reset and Run Server

  1. Initialize Backend Database
$ git pull origin master
$ mysql -u user -p
# login mysql
> show databases;
> drop database temp_db;
> create databse temp_db;
> exit;
  1. Reset Migrations
$ cd backend/triplannet
$ find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
$ find . -path "*/migrations/*.pyc"  -delete
  1. Ready for runserver
$ python manage.py migrate --settings=triplannet.settings.deploy
$ python manage.py makemigrations --settings=triplannet.settings.deploy
  1. Build Frontend
$ sudo npm run build --prod
  1. deploy server
$ sudo systemctl restart nginx
$ uwsgi --http :8000 --wsgi-file /home/swpp-team6/swpp2019-team6/backend/triplannet/triplannet/wsgi/deploy.py

@deploy-soon
Copy link
Contributor

서버 일단 켜두고 screen swpp-team6 session에 backend 켜두겠습니다

cc. @jangdonghae @dreamsh19 @rxwe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Setting Set up for the server
Projects
None yet
Development

No branches or pull requests

3 participants