Skip to content

Commit 0b940d9

Browse files
coliseeRobin Alexander
andauthored
Review the content of directory .examples for docker (#146)
* Review the content of directory .examples for docker * Makefile created by accident in previous commit --------- Co-authored-by: Robin Alexander <colisee@hotmail>
1 parent a8155e9 commit 0b940d9

9 files changed

Lines changed: 81 additions & 163 deletions

File tree

.examples/docker/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Run librebooking with docker
2+
3+
Adapt files `db.env`and `lb.env` to your needs.
4+
5+
## Using the command line: local access
6+
7+
This setup is meant for accessing the application from your local network.
8+
It features:
9+
10+
* A librebooking container reachable at <http://localhost>
11+
* A docker volume storing the configuration files
12+
13+
Create a docker network
14+
15+
```sh
16+
docker network create librebooking
17+
```
18+
19+
Start the containers
20+
21+
```sh
22+
docker run \
23+
--detach \
24+
--name librebooking-db \
25+
--network librebooking \
26+
--volume librebooking-db:/config \
27+
--env-file db.env \
28+
--env MYSQL_ROOT_PASSWORD=db_root_pwd \
29+
linuxserver/mariadb:10.6.13
30+
31+
docker run \
32+
--detach \
33+
--name librebooking-app \
34+
--network librebooking \
35+
--publish 8080:8080 \
36+
--volume librebooking-conf:/config \
37+
--env-file lb.env \
38+
--env LB_DATABASE_PASSWORD=db_user_pwd \
39+
--env LB_INSTALL_PASSWORD=app_install_pwd \
40+
librebooking/librebooking:4.1.0
41+
```
42+
43+
## Using docker compose: local access
44+
45+
This setup is meant for accessing the application from your local network.
46+
It features:
47+
48+
* A librebooking container reachable at <http://localhost>
49+
* A docker volume storing the configuration files
50+
* A librebooking container used to run cron jobs
51+
52+
Start the application
53+
54+
```sh
55+
docker compose --file docker-compose-local.yml up --detach
56+
```
57+
58+
## Using docker compose: public access
59+
60+
This setup is meant for accessing the application from the internet.
61+
It features:
62+
63+
* A reverse proxy based on nginx that automatically handle certificates
64+
* A librebooking service `lb1` reachable at <https://your.host.com/book>
65+
* A librebooking service `lb2` reachable at <https://your.host.com>
66+
* 2 librebooking services `job1` and `job2` to handle cron jobs
67+
* The usage of secrets to forward passwords to both containers
68+
69+
Set the secret files
70+
71+
```sh
72+
echo -n 'db_root_pwd' > pwd_db_root.txt;
73+
echo -n 'db_user_pwd' > pwd_db_user.txt;
74+
echo -n 'app_install_pwd' > pwd_lb_inst.txt;
75+
```
76+
77+
Start the application
78+
79+
```sh
80+
docker compose --file docker-compose-public.yml up --detach
81+
```

.examples/secure/docker-compose.yml renamed to .examples/docker/docker-compose-public.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ services:
44
proxy:
55
image: nginxproxy/nginx-proxy
66
restart: always
7-
networks:
8-
- mynet
97
ports:
108
- 80:80
119
- 443:443
@@ -148,6 +146,3 @@ secrets:
148146
file: ./pwd_db_user.txt
149147
lb_install_pwd:
150148
file: ./pwd_lb_inst.txt
151-
152-
networks:
153-
mynet:

.examples/insecure/README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

.examples/insecure/start.sh

Lines changed: 0 additions & 54 deletions
This file was deleted.

.examples/insecure/stop.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

.examples/secure/README.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)