diff options
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-x | docker/entrypoint.sh | 40 |
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 | |||
3 | echo << EOL | ||
4 | ------------------------------------- | ||
5 | ____ ___ | ||
6 | / __/__ _______/ (_) | ||
7 | / _// -_) __/ _ / / | ||
8 | _/_/ \__/_/ \_,_/_/ | ||
9 | / __/__ _____ _____ ____ | ||
10 | _\ \/ -_) __/ |/ / -_) __/ | ||
11 | /___/\__/_/ |___/\__/_/ | ||
12 | Brought to you by getferdi.com | ||
13 | Support our Open Collective at: | ||
14 | https://opencollective.com/getferdi/ | ||
15 | EOL | ||
16 | |||
17 | # Create APP key if needed | ||
18 | if [ ! -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 | ||
27 | elif [ -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 ****" | ||
34 | fi | ||
35 | |||
36 | export APP_KEY=$APP_KEY | ||
37 | |||
38 | node ace migration:run --force | ||
39 | |||
40 | exec node server.js | ||