diff options
author | thursday <xthursdayx@mailbox.org> | 2021-09-18 02:21:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-18 02:21:13 -0400 |
commit | 2b3b2ae202bc24c0db9f135b9d5865abefa16afb (patch) | |
tree | c952dbef8aba5db71a652759a32cbb8a35f4fac9 /docker/entrypoint.sh | |
parent | Bump tar from 4.4.15 to 4.4.19 (diff) | |
parent | Fixed NGINX config example indentation. (diff) | |
download | ferdium-server-2b3b2ae202bc24c0db9f135b9d5865abefa16afb.tar.gz ferdium-server-2b3b2ae202bc24c0db9f135b9d5865abefa16afb.tar.zst ferdium-server-2b3b2ae202bc24c0db9f135b9d5865abefa16afb.zip |
Merge pull request #48 from k0staa/master
Moving the server-docker repository to the server repository and enabling image building from the current version of the application code
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-x | docker/entrypoint.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 0000000..2a91839 --- /dev/null +++ b/docker/entrypoint.sh | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | cat << 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 [[ -z ${APP_KEY} && ! -f "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then | ||
19 | echo "**** Generating Ferdi-server app key for first run ****" | ||
20 | adonis key:generate | ||
21 | APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2) | ||
22 | echo "${APP_KEY}" > "${DATA_DIR}/FERDI_APP_KEY.txt" | ||
23 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" | ||
24 | else APP_KEY=$(cat "${DATA_DIR}/FERDI_APP_KEY.txt") | ||
25 | echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" | ||
26 | fi | ||
27 | |||
28 | export APP_KEY | ||
29 | |||
30 | node ace migration:run --force | ||
31 | |||
32 | chown -R "${PUID:-1000}":"${PGID:-1000}" "$DATA_DIR" /app | ||
33 | |||
34 | su-exec "${PUID:-1000}":"${PGID:-1000}" node server.js#!/bin/bash | ||