aboutsummaryrefslogtreecommitdiffstats
path: root/docker/entrypoint.sh
diff options
context:
space:
mode:
authorLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-07 12:43:41 +0100
committerLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-07 12:43:41 +0100
commit7329a7fd852082f0216b4f67f1912eaa601981fc (patch)
tree1209c90933e646dbbfa1bbc706eb6ec48d5d5050 /docker/entrypoint.sh
parentModifying Dockerfile so that it can use the current application code to build... (diff)
downloadferdium-server-7329a7fd852082f0216b4f67f1912eaa601981fc.tar.gz
ferdium-server-7329a7fd852082f0216b4f67f1912eaa601981fc.tar.zst
ferdium-server-7329a7fd852082f0216b4f67f1912eaa601981fc.zip
Add new configuration for docker with small script to generate or use APP_KEY. docker-compose was adjusted to use DATA_DIR.
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-xdocker/entrypoint.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
new file mode 100755
index 0000000..cb0dd0f
--- /dev/null
+++ b/docker/entrypoint.sh
@@ -0,0 +1,40 @@
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# Create APP key if needed
18if [ ! -f "/config/FERDI_APP_KEY.txt" ];
19 then
20 echo " "
21 echo "**** Generating Ferdi-server app key for first run ****"
22 adonis key:generate
23 source .env
24 echo $APP_KEY > /config/FERDI_APP_KEY.txt
25 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
26 sed -i "s/APP_KEY=/APP_KEY=$APP_KEY/g" /config/config.txt
27elif [ -f "/config/FERDI_APP_KEY.txt" ];
28 then
29 echo " "
30 echo "**** App Key found ****"
31 APP_KEY=$(cat /config/FERDI_APP_KEY.txt)
32 sed -i "s/APP_KEY=.*/APP_KEY=$APP_KEY/g" /config/config.txt
33 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
34fi
35
36export APP_KEY=$APP_KEY
37
38node ace migration:run --force
39
40exec node server.js