-
Notifications
You must be signed in to change notification settings - Fork 3
/
entrycheck
executable file
·36 lines (36 loc) · 1.32 KB
/
entrycheck
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
34
35
36
#!/bin/bash
#
# Made by Ivann LARUELLE / larueli on GitHub and Docker Hub
# decidim-nonroot on Docker Hub and GitHub
#
echo "Container made by Ivann LARUELLE <ivann.laruelle@gmail.com>"
echo "You will find more info on DockerHub and GitHub : larueli/decidim-nonroot"
echo "-------------------------------------------------------------------------"
wait-hosts
echo "---- Initialization of the container ----"
export RAILS_ENV=production
rm /decidim-app/tmp/pids/server.pid
cd /decidim-app
echo "---- Execute init scripts ----"
if [ -d /docker-entrypoint-initdecidim.d ]
then
if [ ! -z $(ls /docker-entrypoint-initdecidim.d/) ]
then
for f in /docker-entrypoint-initdecidim.d/*; do
echo " - Running $f"
bash "$f" -H
done
fi
fi
if [ ! "$(ls -A /decidim-app/config)" ]; then
mv -f /tmp/decidim-config/* /decidim-app/config/
sed -i 's/# config.force_ssl = true/config.force_ssl = false/' /decidim-app/config/environments/production.rb
sed -i 's/# config.force_ssl = true/config.force_ssl = false/' /decidim-app/config/initializers/decidim.rb
fi
RAILS_ENV=production bin/rails decidim:upgrade
echo "---- Connecting to DB ----"
echo "If db already exists, show errors, no worries !"
RAILS_ENV=production bin/rails db:migrate
echo "---- Launch Server ----"
RAILS_ENV=production bin/delayed_job start
RAILS_ENV=production bin/rails s