aboutsummaryrefslogtreecommitdiffstats
path: root/docker/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-xdocker/entrypoint.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
new file mode 100755
index 0000000..0679530
--- /dev/null
+++ b/docker/entrypoint.sh
@@ -0,0 +1,37 @@
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 "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then
19 echo " "
20 echo "**** App Key found ****"
21 APP_KEY=$(echo "${APP_KEY}")
22 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
23elif [[ -z "${APP_KEY}" ]]; then
24 echo "**** Generating Ferdi-server app key for first run ****"
25 adonis key:generate
26 APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2)
27 echo "${APP_KEY}" > "${DATA_DIR}/FERDI_APP_KEY.txt"
28 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
29fi
30
31export APP_KEY
32
33node ace migration:run --force
34
35chown -R ${PUID:-1000}:${PGID:-1000} $DATA_DIR /app
36
37su-exec ${PUID:-1000}:${PGID:-1000} node server.js