aboutsummaryrefslogtreecommitdiffstats
path: root/docker/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-xdocker/entrypoint.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
new file mode 100755
index 0000000..8d00250
--- /dev/null
+++ b/docker/entrypoint.sh
@@ -0,0 +1,47 @@
1#!/bin/sh
2
3echo << EOL
4-------------------------------------
5 ____ ___
6 / __/__ _______/ (_)
7 / _// -_) __/ _ / /
8 _/_/ \__/_/ \_,_/_/
9 / __/__ _____ _____ ____
10 _\ \/ -_) __/ |/ / -_) __/
11 /___/\__/_/ |___/\__/_/
12Brought to you by getferdi.com
13Support our Open Collective at:
14https://opencollective.com/getferdi/
15EOL
16
17# Use of config.txt in this image is deprecated. Users should include the environmental variables listed in the README.md when the running the container or use docker compose with an .env file based on the included .env.example.
18#if [ -f /config/config.txt ]; then
19# cp /config/config.txt /app/.env
20#else
21# cp /app/.env.example /app/.env
22#fi
23
24# Create APP key if needed
25if [ ! -f "/config/FERDI_APP_KEY.txt" ];
26 then
27 echo " "
28 echo "**** Generating Ferdi-server app key for first run ****"
29 adonis key:generate
30 APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2)
31 echo $APP_KEY > /config/FERDI_APP_KEY.txt
32 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
33 sed -i "s/APP_KEY=/APP_KEY=$APP_KEY/g" /config/config.txt
34elif [ -f "/config/FERDI_APP_KEY.txt" ];
35 then
36 echo " "
37 echo "**** App Key found ****"
38 APP_KEY=$(cat /config/FERDI_APP_KEY.txt)
39 sed -i "s/APP_KEY=.*/APP_KEY=$APP_KEY/g" /config/config.txt
40 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
41fi
42
43export APP_KEY
44
45node ace migration:run --force
46
47exec node server.js