-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure_web_server.sh
32 lines (28 loc) · 1.01 KB
/
configure_web_server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
echo "Django migration"
source ~/ENV/bin/activate
python3 ~/cloud_station_web/manage.py makemigrations
python3 ~/cloud_station_web/manage.py migrate
python3 ~/cloud_station_web/manage.py migrate --run-syncdb
echo "Collecting staticfiles"
if [ ! -d "~/cloud_station_web/static" ]; then
mkdir ~/cloud_station_web/static
fi
python3 ~/cloud_station_web/manage.py collectstatic --no-input
echo "Configuring NGINX and Daphne"
sudo cp ~/cloud_station_deployment/nginx.conf /etc/nginx
if [ ! -d "~/logs" ]; then
mkdir ~/logs
fi
sudo service nginx restart
sudo cp ~/cloud_station_deployment/daphne.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start daphne.service
echo "Configuring django-background-tasks"
sudo cp ~/cloud_station_deployment/backgroundtasks.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start backgroundtasks.service
echo "Running docker (redis)"
sudo systemctl start docker
sudo systemctl enable docker
sudo docker run -p 6379:6379 -d redis:7.2.3