Skip to content

Commit b17d276

Browse files
committed
sample compose files, readme updates, fixed seds, symlinks
1 parent 332c560 commit b17d276

File tree

4 files changed

+74
-3
lines changed

4 files changed

+74
-3
lines changed

docker-compose.advanced.yml.sample

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: '3'
2+
services:
3+
sql:
4+
container_name: bookstack_sql
5+
image: linuxserver/mariadb
6+
volumes:
7+
- ./data/sql:/config
8+
networks:
9+
- net
10+
environment:
11+
- PUID=setyourID
12+
- PGID=setyourGID
13+
- MYSQL_ROOT_PASSWORD=SetAPassword
14+
bookstack:
15+
container_name: bookstack
16+
image: linuxserver/bookstack
17+
volumes:
18+
- ./data/bookstack:/config
19+
environment:
20+
- ADVANCED_MODE=1
21+
- PUID=setyourID
22+
- PGID=setyourGID
23+
networks:
24+
- net
25+
networks:
26+
net:

docker-compose.basic.yml.sample

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '3'
2+
services:
3+
sql:
4+
container_name: bookstack_sql
5+
image: linuxserver/mariadb
6+
volumes:
7+
- ./data/sql:/config
8+
networks:
9+
- net
10+
environment:
11+
- PUID=setyourID
12+
- PGID=setyourGID
13+
- MYSQL_ROOT_PASSWORD=SetAPassword
14+
bookstack:
15+
container_name: bookstack
16+
image: linuxserver/bookstack
17+
volumes:
18+
- ./data/bookstack:/config
19+
environment:
20+
- DB_USER=bookstack
21+
- DB_PASS=SetAPassword
22+
- DB_DATABASE=bookstack
23+
- DB_HOST=bookstack_sql
24+
- "APP_URL=https://your.url.when.using.reverse.proxy"
25+
- PUID=setyourID
26+
- PGID=setyourGID
27+
networks:
28+
- net
29+
networks:
30+
net:

readme-vars.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ param_env_vars:
3030
- { env_var: "DB_PASS", env_value: "<yourdbpass>", desc: "for specifying the database password" }
3131
- { env_var: "DB_DATABASE", env_value: "bookstackapp", desc: "for specifying the database to be used" }
3232
- { env_var: "APPURL", env_value: "your.site.here.xyz", desc: "for specifying the url your application will be accessed on "}
33+
- { env_var: "ADVANCED_MODE", env_value: "1", desc: "enables advanced mode for direct editing of the .env - scroll down for details on this"}
3334

3435
param_usage_include_ports: true
3536
param_ports:
@@ -62,7 +63,19 @@ app_setup_block: |
6263
6364
Documentation can be found at https://www.bookstackapp.com/docs/
6465
66+
### Advanced Mode
67+
We have implemented a special 'advanced mode' where users who wish to leverage the built in SMTP or LDAP functionality, will have the ability to edit the .env by hand. With `ADVANCED_MODE=1` set when
68+
the container is created, it will copy the .env.example to /config within the container. You can then edit this file on the host system (make sure you read the BookStack docs) and restart the
69+
container when finished. When the container starts, it copies /config/.env to /var/www/html/.env within the container for the web app to use. It will do this every time the container restarts.
70+
71+
Note, the APP_KEY is still set by PHP environment so you do not need to worrry about this.
72+
73+
### Composer
74+
75+
Some simple docker-compose files are included for you to get started with. You will still need to manually configure the SQL server, but the compose files will get the stack running for you.
76+
6577
# changelog
6678
changelogs:
79+
- { date: "08.10.18:", desc: "Advanced mode, symlink changes, sed fixing, docs updated, added some composer files"}
6780
- { date: "23.09.28:", desc: "Updates pre-release"}
6881
- { date: "02.07.18:", desc: "Initial Release." }

root/etc/cont-init.d/50-config

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# create directory structure
44
mkdir -p \
5-
/config/www/{files,images,uploads,logs}
5+
/config/www/{storage,public}
66

77
# create symlinks
88
symlinks=( \
@@ -21,7 +21,7 @@ done
2121
# If not set, runs in basic mode where .example.env is copied to /var/www/html/.env and seds are applied to set documented variables
2222
if [ "$ADVANCED_MODE" == 1 ];
2323
then
24-
echo "Advanced Mode Enabled - Syncing .env from /config to /var/www/html"
24+
echo "Advanced Mode Enabled - Syncing .env from /config to /var/www/html - if you're doing this you better read the BookStack documentation. Restart container after making changes to .env"
2525
[[ ! -f "/config/.env" ]] && \
2626
cp /var/www/html/.env.example /config/.env
2727
cp /config/.env /var/www/html/.env
@@ -35,7 +35,9 @@ elif [ -z "$ADVANCED_MODE" ];
3535
sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env
3636
sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env
3737
sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env
38-
sed -i "s/# APP_URL=http://bookstack.dev/APP_URL=${APP_URL}/g" /var/www/html/.env
38+
elif [ "$APP_URL" ]
39+
echo "App URL Set"
40+
sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env
3941
else
4042
echo "Nothing to do with .env - what did you do homer?"
4143
fi

0 commit comments

Comments
 (0)