diff options
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-x | docker/entrypoint.sh | 47 |
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 | |||
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 | # 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 | ||
25 | if [ ! -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 | ||
34 | elif [ -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 ****" | ||
41 | fi | ||
42 | |||
43 | export APP_KEY | ||
44 | |||
45 | node ace migration:run --force | ||
46 | |||
47 | exec node server.js | ||