This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
apt-get update | |
apt-get install -y docker-engine | |
systemctl enable docker | |
usermod -aG docker ubuntu | |
docker info | |
curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen 443 ssl; | |
server_name A.B.C.D app1-domain; | |
ssl_certificate /etc/letsencrypt/live/app1/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/app1/privkey.pem; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:uwsgi] | |
command=/home/ubuntu/virtualenv/app/bin/uwsgi --http 0.0.0.0:8000 -b 65535 --chdir /home/ubuntu/app --wsgi-file /home/ubuntu/app/appdir/wsgi.py --virtualenv /home/ubuntu/virtualenv/app | |
user=ubuntu | |
numprocs=1 | |
stdout_logfile=/var/log/uwsgi/access.log | |
stderr_logfile=/var/log/uwsgi/error.log | |
autostart=true | |
autorestart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:celerybeat] | |
command=/home/ubuntu/virtual-env/app/bin/python manage.py celery beat | |
directory=/home/ubuntu/app | |
environment=C_FORCE_ROOT=true | |
user=ubuntu | |
numprocs=1 | |
stdout_logfile=/var/log/celerybeat/access.log | |
stderr_logfile=/var/log/celerybeat/error.log | |
autostart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:celeryd] | |
command=/home/ubuntu/virtual-env/app/bin/python manage.py celeryd -l INFO | |
directory=/home/ubuntu/app | |
environment=C_FORCE_ROOT=true | |
user=ubuntu | |
numprocs=1 | |
stdout_logfile=/var/log/celeryd/access.log | |
stderr_logfile=/var/log/celeryd/error.log | |
autostart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:dcmqrscp] | |
command=dcmqrscp --config /home/ubuntu/app/dcmqrscp.cfg | |
user=ubuntu | |
numprocs=1 | |
stdout_logfile=/var/log/dcmqrscp/access.log | |
stderr_logfile=/var/log/dcmqrscp/error.log | |
autostart=true | |
autorestart=true | |
startsecs=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:dcmtk_listener] | |
command=storescp 5555 -aet app -xcs '. /home/ubuntu/virtual-env/app/bin/activate; cd /home/ubuntu/app/; python manage.py add_dicom #p' --log-config /home/ubuntu/app/dcmtk_log_config.txt -od /home/ubuntu/app/dicoms/ -su ah -tos 30 --accept-all -fe '.dcm' | |
environment=C_FORCE_ROOT=true | |
user=ubuntu | |
numprocs=1 | |
stdout_logfile=/var/log/dcmtk_listener/access.log | |
stderr_logfile=/var/log/dcmtk_listener/error.log | |
autostart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:flower] | |
command=/home/ubuntu/virtual-env/app/bin/flower --address=0.0.0.0 --port=5000 --basic_auth=USER:PASSWORD | |
user=ubuntu | |
numprocs=1 | |
stdout_logfile=/var/log/flower/access.log | |
stderr_logfile=/var/log/flower/error.log | |
autostart=true | |
autorestart=true | |
startsecs=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo crontab -e | |
@reboot sudo -u rabbitmq rabbitmqctl stop_app && sudo -u rabbitmq rabbitmqctl force_reset && sudo -u rabbitmq rabbitmqctl start_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/ubuntu | |
status=$(sudo supervisorctl status celerybeat | grep -o FATAL) | |
if [ "$status" == "FATAL" ] | |
then | |
echo "Celerybeat service is Down!" | mail -s "Celerybeat Down" admin@domain.com, admin2@domain.com, admin3@domain.com > /dev/null 2>&1 | |
sudo supervisorctl restart all > /dev/null 2>&1 | |
status=$(sudo supervisorctl status celerybeat | grep -o RUNNING) | |
if [ "$status" == "RUNNING" ] | |
then |