-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflarum-run
52 lines (41 loc) · 1.46 KB
/
flarum-run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
set -e
chown "$UID:$GID" /app /data/caddy /config/caddy
install -o "$UID" -g "$GID" -d \
storage/cache \
storage/formatter \
storage/less \
storage/locale \
storage/logs \
storage/sessions \
storage/tmp \
storage/views \
public/assets/avatars
if [ -e 'storage/install.lock' ]; then
echo "Already installed"
install -o "$UID" -g "$GID" config.docker.php config.php
else
echo "Installing"
rm -f config.php
cfg=install.yml
echo "debug: false" >> $cfg
echo "baseUrl: ${FLARUM_URL:-http://localhost}" >> $cfg
echo "databaseConfiguration:" >> $cfg
echo " driver: mysql" >> $cfg
echo " host: ${FLARUM_DB_HOST:-db}" >> $cfg
echo " database: ${FLARUM_DB_DATABASE:-flarum}" >> $cfg
echo " username: ${FLARUM_DB_USERNAME:-flarum}" >> $cfg
echo " password: ${FLARUM_DB_PASSWORD:-flarum}" >> $cfg
echo " prefix: ${FLARUM_DB_PREFIX}" >> $cfg
echo " port: ${FLARUM_DB_PORT:-3306}" >> $cfg
echo "adminUser:" >> $cfg
echo " username: ${FLARUM_INSTALL_ADMIN_USERNAME}" >> $cfg
echo " password: ${FLARUM_INSTALL_ADMIN_PASSWORD}" >> $cfg
echo " email: ${FLARUM_INSTALL_ADMIN_EMAIL}" >> $cfg
echo "settings:" >> $cfg
echo " forum_title: ${FLARUM_TITLE:-Flarum}" >> $cfg
php flarum install -f $cfg
rm $cfg
install -o "$UID" -g "$GID" /dev/null storage/install.lock
fi
su-exec "$UID:$GID" frankenphp run --config /etc/caddy/Caddyfile --adapter caddyfile