Skip to content

Commit 77339ae

Browse files
authored
docs: add chapter for volume handling
updated bookstack version in bash commands adjusted Docker < 1.9 bash commands white space adjustments
1 parent 30c6fae commit 77339ae

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

README.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,64 @@
55
## Current Version: [0.29.3](https://github.com/SolidNerd/docker-bookstack/blob/master/Dockerfile)
66

77
### Changes
8-
In 0.28.0 we changed the container http port from 80 to 8080 to allow root privileges to be dropped
8+
9+
In 0.28.0 we changed the container http port from 80 to 8080 to allow root privileges to be dropped
910
In 0.12.2 we removed `DB_PORT` . You can now specify the port via `DB_HOST` like `DB_HOST=mysql:3306`
1011

1112
### Quickstart
13+
1214
With Docker Compose is a Quickstart very easy. Run the following command:
1315

1416
```
1517
docker-compose up
1618
```
1719

18-
and after that open your Browser and go to [http://localhost:8080](http://localhost:8080) .
20+
and after that open your Browser and go to [http://localhost:8080](http://localhost:8080) . You can login with username 'admin@admin.com' and password 'password'.
1921

2022
### Issues
2123

2224
If you have any issues feel free to create an [issue on GitHub](https://github.com/solidnerd/docker-bookstack/issues).
2325

2426

2527
### How to use the Image without Docker compose
28+
29+
Note that if you want to use LDAP, `$` has to be escape like `\$`, i.e. `-e "LDAP_USER_FILTER"="(&(uid=\${user}))"`
30+
2631
Networking changed in Docker v1.9, so you need to do one of the following steps.
2732

2833
#### Docker < v1.9
34+
2935
1. MySQL Container:
36+
3037
```bash
31-
docker run -d --name bookstack-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=bookstack -e MYSQL_USER=bookstack -e MYSQL_PASSWORD=secret mysql:5.7.21
38+
docker run -d \
39+
-p 3306:3306 \
40+
-e MYSQL_ROOT_PASSWORD=secret \
41+
-e MYSQL_DATABASE=bookstack \
42+
-e MYSQL_USER=bookstack \
43+
-e MYSQL_PASSWORD=secret \
44+
--name bookstack_db \
45+
mysql:5.7.21
3246
```
3347
2. BookStack Container:
48+
3449
```bash
35-
docker run --name my-bookstack -d --link bookstack-mysql:mysql -p 8080:8080 solidnerd/bookstack:0.29.3
50+
docker run -d --link bookstack_db_:mysql \
51+
-p 8080:8080 \
52+
--name bookstack_0.29.3 \
53+
solidnerd/bookstack:0.29.3
3654
```
3755

3856
#### Docker 1.9+
3957

40-
1.Create a shared network:
58+
1. Create a shared network:
4159

4260
```bash
4361
docker network create bookstack_nw
4462
```
4563

46-
2.MySQL container :
64+
2. Run MySQL container :
65+
4766
```bash
4867
docker run -d --net bookstack_nw \
4968
-e MYSQL_ROOT_PASSWORD=secret \
@@ -54,22 +73,30 @@ docker run -d --net bookstack_nw \
5473
mysql:5.7.21
5574
```
5675

57-
58-
3.Create BookStack Container
76+
3. Run BookStack Container
5977

6078
```bash
61-
docker run -d --net bookstack_nw \
79+
docker run -d --net bookstack_nw \
6280
-e DB_HOST=bookstack_db:3306 \
6381
-e DB_DATABASE=bookstack \
6482
-e DB_USERNAME=bookstack \
6583
-e DB_PASSWORD=secret \
6684
-p 8080:8080 \
67-
solidnerd/bookstack:0.27.4-1
85+
--name="bookstack_0.29.3" \
86+
solidnerd/bookstack:0.29.3
6887
```
6988

70-
After the steps you can visit [http://localhost:8080](http://localhost:8080) . You can login with username 'admin@admin.com' and password 'password'.
89+
#### Volumes
90+
To access your `.env` file and important bookstack folders on your host system change `<HOST>` in the following line to your host directory and add it then to your run command:
7191

72-
Note that if you want to use LDAP, `$` has to be escape like `\$`, i.e. `-e "LDAP_USER_FILTER"="(&(uid=\${user}))"`
92+
```bash
93+
--mount type=bind,source=<HOST>/.env,target=/var/www/bookstack/.env \
94+
-v <HOST>:/var/www/bookstack/public/uploads \
95+
-v <HOST>:/var/www/bookstack/storage/uploads
96+
```
97+
In case of a windows host machine the .env file has to be already created in the host directory otherwise a folder named .env will be created.
98+
99+
After these steps you can visit [http://localhost:8080](http://localhost:8080) . You can login with username 'admin@admin.com' and password 'password'.
73100

74101
### Inspiration
75102

0 commit comments

Comments
 (0)