forked from KoalixSwitzerland/koalixcrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.prod.sh
33 lines (25 loc) · 1.13 KB
/
entrypoint.prod.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
33
#!/bin/bash
# Install dependencies
pip install -r base_requirements.txt
# Install FOP 2.2
wget http://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-2.2-bin.tar.gz
tar -xzf fop-2.2-bin.tar.gz -C ../usr/bin
rm -rf fop-2.2-bin.tar.gz
chmod 755 ../usr/bin/fop-2.2/fop
# Install Java 8
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz
tar -xzf jdk-8u162-linux-x64.tar.gz -C ../usr/bin
rm -rf jdk-8u162-linux-x64.tar.gz
# Create /media/uploads/ directory which is required by django filebrowser
mkdir -p projectsettings/media/uploads
chmod -R 755 projectsettings/media
# Create /static/pdf for FOP PDF export
mkdir -p projectsettings/static/pdf
chmod -R 755 projectsettings/static/pdf
# Execute startup scripts
python manage.py collectstatic --noinput
python manage.py migrate
# Create django user, will own the media dir
adduser --no-create-home --disabled-login --group --system django
chown -R django:django /app/projectsettings/media
/usr/local/bin/uwsgi --emperor /etc/uwsgi/django-uwsgi.ini