aeupdates.com
- create file `production_settings.py` in `/aeupdates`, similar as `settings.py` ``` cd deploy/django_docker docker build -t aeupdates -f deploy/django_docker/Dockerfile docker run -it -p 8080:8080 -p 8084:8084 -t aeupdates ```-
stop old main contaier
docker stop <container_id>
-
ansible-playbook -l production -i deploy/hosts deploy/deploy.yml -vvvv --extra-vars "DEPLOYING_ENDPOINT=production"
oransible-playbook -l staging -i deploy/hosts deploy/deploy.yml -vvvv --extra-vars "DEPLOYING_ENDPOINT=staging"
-
Change HOST in
/apps/frontend/config/enviroment.js
:ENV.APP.API_HOST = 'http://37.139.30.9:8080'
; -
Fix static files for django:
python manage.py collectstatic
(also done by every build)
If instance is new or migrations needed 1)python manage.py migrate 2)python manage.py createsuperuser
###Local installation for Mac developers:
pip install virtualenvwrapper
add the following lines to your ~/.bashrc
file:
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
then run
source ~/.bashrc
mkvirtualenv -p /path/to/python3.4 aeupdates
- install psql:
brew install postgresql
- install mongodb:
brew install mongodb
- install requirements:
pip install -r requirements.txt
- create file
secret_config.py
nearpublic_config
- run migrations -
python manage.py migrate
- create superuser -
python manage.py createsuperuser
- install ember if not installed
npm install -g [email protected]
- install bower if not installed
npm install -g bower
cd aeupdates/depoloy
docker build -t aeupdates django_docker
then push to hub - https://docs.docker.com/engine/getstarted/step_six/
python manage.py --settings=aeupdates.production_settings makemigrations corsheaders
python manage.py --settings=aeupdates.production_settings migrate
docker exec -it <image_id> bash
psql -U postgres
# Delete all stopped containers
docker rm $( docker ps -q -f status=exited)
# Delete all dangling (unused) images
docker rmi $( docker images -q -f dangling=true)
# Delete all non-tagged images
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
/usr/sbin/nginx -s stop
certbot certonly --standalone -d aeupdates.com
service nginx start
If you ever want to stop the Agent, run:
sudo /etc/init.d/datadog-agent stop
And to run it again run:
sudo /etc/init.d/datadog-agent start
look for processes ps -aux | grep "nginx"
stop processes /usr/sbin/nginx -s stop
read logs cat /var/log/nginx/error.log
docker exec -i -t <id> /bin/bash
mongodump --out /mongodb_dumped_db
tar -zcvf mongodbdumped.tar.gz /mongodb_dumped_db/
exit from container
docker cp <id>:/mongodbdumped.tar.gz mongodbdumped.tar.gz
exit from ssh session
scp user@<ip>:~/mongodbdumped.tar.gz ~/mongodumped.tar.gz
cd ~ && tar -zxvf mongodumped.tar.gz && mongorestore mongodb_dumped_db