Skip to content

Commit 6d36e19

Browse files
Robin Alexanderikke-t
authored andcommitted
Review docker examples
* Make consistent usage of environment files * Include passwords inside environment files * Use image librebooking/librebooking:4.1.0
1 parent 86c9f47 commit 6d36e19

6 files changed

Lines changed: 47 additions & 55 deletions

File tree

.examples/docker/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Run librebooking with docker
22

3-
Adapt files `db.env`and `lb.env` to your needs.
4-
53
## Using the command line: local access
64

75
This setup is meant for accessing the application from your local network.
@@ -10,6 +8,8 @@ It features:
108
* A librebooking container reachable at <http://localhost>
119
* A docker volume storing the configuration files
1210

11+
Adapt files `db.env`and `lb.env` to your needs
12+
1313
Create a docker network
1414

1515
```sh
@@ -25,7 +25,6 @@ docker run \
2525
--network librebooking \
2626
--volume librebooking-db:/config \
2727
--env-file db.env \
28-
--env MYSQL_ROOT_PASSWORD=db_root_pwd \
2928
linuxserver/mariadb:10.6.13
3029

3130
docker run \
@@ -35,8 +34,6 @@ docker run \
3534
--publish 8080:8080 \
3635
--volume librebooking-conf:/config \
3736
--env-file lb.env \
38-
--env LB_DATABASE_PASSWORD=db_user_pwd \
39-
--env LB_INSTALL_PASSWORD=app_install_pwd \
4037
librebooking/librebooking:4.1.0
4138
```
4239

@@ -49,6 +46,8 @@ It features:
4946
* A docker volume storing the configuration files
5047
* A librebooking container used to run cron jobs
5148

49+
Adapt files `db.env`and `lb.env` to your needs
50+
5251
Start the application
5352

5453
```sh
@@ -66,6 +65,8 @@ It features:
6665
* 2 librebooking services `job1` and `job2` to handle cron jobs
6766
* The usage of secrets to forward passwords to both containers
6867

68+
Adapt files `db.env`, `lb1.env` and `lb2.env` to your needs
69+
6970
Set the secret files
7071

7172
```sh

.examples/docker/docker-compose-local.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
env_file:
1010
- db.env
1111
app:
12-
image: librebooking/librebooking:develop
12+
image: librebooking/librebooking:4.1.0
1313
restart: always
1414
depends_on:
1515
- db
@@ -20,7 +20,7 @@ services:
2020
env_file:
2121
- lb.env
2222
cron:
23-
image: librebooking/librebooking:develop
23+
image: librebooking/librebooking:4.1.0
2424
restart: always
2525
user: root
2626
entrypoint: /usr/local/bin/cron.sh

.examples/docker/docker-compose-public.yml

Lines changed: 14 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,23 @@ services:
2929
volumes:
3030
- db_conf:/config
3131
environment:
32-
- PUID=1000
33-
- PGID=1000
34-
- TZ=Europe/Zurich
3532
- FILE__MYSQL_ROOT_PASSWORD=/run/secrets/db_root_pwd
33+
env_file:
34+
- db.env
3635
secrets:
3736
- db_root_pwd
3837
- db_user_pwd
3938
lb1:
40-
image: librebooking/librebooking:4.0.0
39+
image: librebooking/librebooking:4.1.0
4140
restart: always
4241
depends_on:
4342
- db
4443
volumes:
4544
- lb1_conf:/config
45+
env_file:
46+
- lb1.env
4647
environment:
4748
- APP_PATH=book
48-
- LB_DATABASE_NAME=lb1
49-
- LB_INSTALL_PASSWORD_FILE=/run/secrets/lb_install_pwd
50-
- LB_DATABASE_USER=lb1
51-
- LB_DATABASE_PASSWORD_FILE=/run/secrets/lb_user_pwd
52-
- LB_DATABASE_HOSTSPEC=db
53-
- LB_LOGGING_FOLDER=/var/log/librebooking
54-
- LB_LOGGING_LEVEL=ERROR
55-
- LB_LOGGING_SQL=false
56-
- LB_DEFAULT_TIMEZONE=Europe/Zurich
57-
- LB_UPLOADS_IMAGE_UPLOAD_URL=Web/uploads/images
58-
- LB_UPLOADS_RESERVATION_ATTACHMENT_PATH=Web/uploads/reservation
5949
- VIRTUAL_HOST=acme.org
6050
- VIRTUAL_PORT=8080
6151
- VIRTUAL_PATH=/book
@@ -64,68 +54,47 @@ services:
6454
- lb_install_pwd
6555
- lb_user_pwd
6656
job1:
67-
image: librebooking/librebooking:4.0.0
57+
image: librebooking/librebooking:4.1.0
6858
restart: always
6959
depends_on:
7060
- lb1
7161
user: root
7262
entrypoint: /usr/local/bin/cron.sh
7363
volumes:
7464
- lb1_conf:/config
75-
environment:
76-
- LB_DATABASE_NAME=lb1
77-
- LB_DATABASE_USER=lb1
78-
- LB_DATABASE_PASSWORD_FILE=/run/secrets/lb_user_pwd
79-
- LB_DATABASE_HOSTSPEC=db
80-
- LB_LOGGING_FOLDER=/var/log/librebooking
81-
- LB_LOGGING_LEVEL=ERROR
82-
- LB_LOGGING_SQL=false
83-
- LB_DEFAULT_TIMEZONE=Europe/Zurich
65+
env_file:
66+
- lb1.env
8467
secrets:
8568
- lb_user_pwd
8669
lb2:
87-
image: librebooking/librebooking:4.0.0
70+
image: librebooking/librebooking:4.1.0
8871
restart: always
8972
depends_on:
9073
- db
9174
volumes:
9275
- lb2_conf:/config
9376
- ./uploads/images:/var/www/html/Web/uploads/images
9477
- ./uploads/reservation:/var/www/html/Web/uploads/reservation
78+
env_file:
79+
- lb2.env
9580
environment:
96-
- LB_DATABASE_NAME=lb2
97-
- LB_INSTALL_PASSWORD_FILE=/run/secrets/lb_install_pwd
98-
- LB_DATABASE_USER=lb2
99-
- LB_DATABASE_PASSWORD_FILE=/run/secrets/lb_user_pwd
100-
- LB_DATABASE_HOSTSPEC=db
101-
- LB_LOGGING_FOLDER=/var/log/librebooking
102-
- LB_LOGGING_LEVEL=ERROR
103-
- LB_LOGGING_SQL=false
104-
- LB_DEFAULT_TIMEZONE=Europe/Zurich
10581
- VIRTUAL_HOST=acme.org
10682
- VIRTUAL_PORT=8080
10783
- LETSENCRYPT_HOST=acme.org
10884
secrets:
10985
- lb_install_pwd
11086
- lb_user_pwd
11187
job2:
112-
image: librebooking/librebooking:4.0.0
88+
image: librebooking/librebooking:4.1.0
11389
restart: always
11490
depends_on:
11591
- lb2
11692
user: root
11793
entrypoint: /usr/local/bin/cron.sh
11894
volumes:
11995
- lb2_conf:/config
120-
environment:
121-
- LB_DATABASE_NAME=lb2
122-
- LB_DATABASE_USER=lb2
123-
- LB_DATABASE_PASSWORD_FILE=/run/secrets/lb_user_pwd
124-
- LB_DATABASE_HOSTSPEC=db
125-
- LB_LOGGING_FOLDER=/var/log/librebooking
126-
- LB_LOGGING_LEVEL=ERROR
127-
- LB_LOGGING_SQL=false
128-
- LB_DEFAULT_TIMEZONE=Europe/Zurich
96+
env_file:
97+
- lb2.env
12998
secrets:
13099
- lb_user_pwd
131100

.examples/docker/lb.env

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
LB_INSTALL_PASSWORD=app_install_pwd
2+
LB_DATABASE_PASSWORD=db_user_pwd
13
LB_DATABASE_NAME=librebooking
24
LB_DATABASE_USER=lb_user
3-
LB_DATABASE_PASSWORD=db_user_pwd
45
LB_DATABASE_HOSTSPEC=db
5-
LB_INSTALL_PASSWORD=app_install_pwd
66
LB_LOGGING_FOLDER=/var/log/librebooking
77
LB_LOGGING_LEVEL=DEBUG
88
LB_LOGGING_SQL=false
99
LB_DEFAULT_TIMEZONE=Europe/Zurich
1010
LB_UPLOADS_IMAGE_UPLOAD_URL=Web/uploads/images
11-
LB_UPLOADS_RESERVATION_ATTACHMENT_PATH=Web/uploads/reservation
11+
LB_UPLOADS_RESERVATION_ATTACHMENT_PATH=Web/uploads/reservation

.examples/docker/lb1.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
LB_INSTALL_PASSWORD_FILE=/run/secrets/lb_install_pwd
2+
LB_DATABASE_PASSWORD_FILE=/run/secrets/lb_user_pwd
3+
LB_DATABASE_NAME=lb1
4+
LB_DATABASE_USER=lb1
5+
LB_DATABASE_HOSTSPEC=db
6+
LB_LOGGING_FOLDER=/var/log/librebooking
7+
LB_LOGGING_LEVEL=ERROR
8+
LB_LOGGING_SQL=false
9+
LB_DEFAULT_TIMEZONE=Europe/Zurich
10+
LB_UPLOADS_IMAGE_UPLOAD_URL=Web/uploads/images
11+
LB_UPLOADS_RESERVATION_ATTACHMENT_PATH=Web/uploads/reservation

.examples/docker/lb2.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
LB_DATABASE_NAME=lb2
2+
LB_DATABASE_USER=lb2
3+
LB_DATABASE_PASSWORD=db_user_pwd
4+
LB_DATABASE_HOSTSPEC=db
5+
LB_INSTALL_PASSWORD=app_install_pwd
6+
LB_LOGGING_FOLDER=/var/log/librebooking
7+
LB_LOGGING_LEVEL=ERROR
8+
LB_LOGGING_SQL=false
9+
LB_DEFAULT_TIMEZONE=Europe/Zurich
10+
LB_UPLOADS_IMAGE_UPLOAD_URL=Web/uploads/images
11+
LB_UPLOADS_RESERVATION_ATTACHMENT_PATH=Web/uploads/reservation

0 commit comments

Comments
 (0)