snipe-it/docker/entrypoint.sh
Kasey 5663429280 applying PR #3456 changes to develop branch (#3472)
* updating with changes made to master

apply PR # 3456 to develop as well

* updating develop with changes made to master

apply PR # 3456 to develop as well

* updating paveit with passport-created oauth tables
2017-03-31 15:43:37 -07:00

30 lines
748 B
Bash

#!/bin/sh
cd /var/www/html
# fix key if needed
if [ -z "$APP_KEY" ]
then
echo "Please re-run this container with an environment variable \$APP_KEY"
echo "An example APP_KEY you could use is: "
php artisan key:generate --show
exit
fi
if [ -f /var/lib/snipeit/ssl/snipeit-ssl.crt -a -f /var/lib/snipeit/ssl/snipeit-ssl.key ]
then
a2enmod ssl
else
a2dismod ssl
fi
# create data directories
for dir in 'data/private_uploads' 'data/uploads' 'data/uploads/avatars' 'data/uploads/barcodes' 'data/uploads/models' 'data/uploads/suppliers' 'dumps'; do
mkdir -p "/var/lib/snipeit/$dir"
done
chown -R docker:root /var/lib/snipeit/data/*
chown -R docker:root /var/lib/snipeit/dumps
. /etc/apache2/envvars
exec apache2 -DNO_DETACH < /dev/null