Skip to content

Commit

Permalink
Prepare v2.1.0 (#47)
Browse files Browse the repository at this point in the history
Changes:
- Fix issue 46

Co-authored-by: Robin <robin.alexander@netplus.ch>
  • Loading branch information
colisee and Robin authored Jun 27, 2023
1 parent ccd8d17 commit e958ae6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 6 deletions.
53 changes: 48 additions & 5 deletions RUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,49 @@ Environment variables are used on first invocation of the container (when the fi
| `LB_LOG_FOLDER` | /var/log/librebooking/log | | **No** | ['settings']['logging']['folder'] |
| `LB_LOG_LEVEL` | debug | none | **No** | ['settings']['logging']['level'] |
| `LB_LOG_SQL` | false | true | **No** | ['settings']['logging']['sql'] |
| `LB_ENV` | production | dev | **No** | N/A - Used to initialize file config.php |

## docker-compose: test environment
## Development environment: using the command line interface
This simple setup is meant for testing the application within your private network.

Run the following commands:
```
# Create the container network
docker network create magnolias
# Run the database
docker run \
--name librebooking-db \
--detach \
--network magnolias \
--volume librebooking-db:/config \
--env PUID=1000 \
--env PGID=1000 \
--env TZ=Europe/Zurich \
--env MYSQL_DATABASE=librebooking \
--env MYSQL_ROOT_PASSWORD=your_Mariadb_root_password \
--env MYSQL_USER=lb_user \
--env MYSQL_PASSWORD=your_Mariadb_user_password \
linuxserver/mariadb:10.6.13
# Run librebooking
docker run \
--name librebooking \
--detach \
--network magnolias \
--publish 80:80 \
--volume librebooking-conf:/config \
--env TZ=Europe/Zurich \
--env LB_DB_HOST=librebooking-db \
--env LB_DB_NAME=librebooking \
--env LB_INSTALL_PWD=your_Librebooking_installation_password \
--env LB_DB_USER=lb_user \
--env LB_DB_USER_PWD=your_Mariadb_user_password \
--env LB_ENV=dev \
librebooking/librebooking:develop-2.1.0
```

## Development environment: using docker compose
This simple setup is meant for testing the application within your private network.

Create a `docker-compose.yml` file from the following sample and adapt the value of the environment variables to your needs:
Expand All @@ -41,7 +82,7 @@ services:
- MYSQL_USER=lb_user
- MYSQL_PASSWORD=your_Mariadb_user_password
app:
image: librebooking/librebooking:2.8.6-2.0
image: librebooking/librebooking:develop-2.1.0
container_name: librebooking
restart: always
depends_on:
Expand All @@ -59,6 +100,7 @@ services:
- LB_INSTALL_PWD=your_Librebooking_installation_password
- LB_DB_USER=lb_user
- LB_DB_USER_PWD=your_Mariadb_user_password
- LB_ENV=dev
volumes:
vol-db:
Expand All @@ -76,7 +118,7 @@ Start the application with the following command:
docker-compose up --detach
```

## docker-compose: production environment
## Production environment: using docker compose
This setup is meant for accessing the application from the internet. It features:
- The [traefik reverse proxy](https://traefik.io/traefik/)
- The usage of secrets to pass passwords to the docker container
Expand Down Expand Up @@ -132,7 +174,7 @@ services:
- db_root_pwd
- db_user_pwd
app:
image: librebooking/librebooking:2.8.6-2.0
image: librebooking/librebooking:2.8.6-2.1.0
container_name: librebooking
restart: always
depends_on:
Expand All @@ -148,6 +190,7 @@ services:
- LB_INSTALL_PWD_FILE=/run/secrets/lb_install_pwd
- LB_DB_USER=lb_user
- LB_DB_USER_PWD_FILE=/run/secrets/lb_user_pwd
- LB_ENV=production
secrets:
- lb_install_pwd
- lb_user_pwd
Expand Down Expand Up @@ -189,4 +232,4 @@ echo -n 'your_Librebooking_installation_password' > lb_install_pwd.txt;
Start the application with the following command:
```
docker-compose up --detach
```
```
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -ex
readonly DFT_LOG_FLR="/var/log/librebooking/log"
readonly DFT_LOG_LEVEL="debug"
readonly DFT_LOG_SQL=false
readonly DFT_LB_ENV="production"

file_env() {
local var="$1"
Expand Down Expand Up @@ -40,6 +41,7 @@ file_env LB_DB_USER_PWD
LB_LOG_FOLDER=${LB_LOG_FOLDER:-${DFT_LOG_FLR}}
LB_LOG_LEVEL=${LB_LOG_LEVEL:-${DFT_LOG_LEVEL}}
LB_LOG_SQL=${LB_LOG_SQL:-${DFT_LOG_SQL}}
LB_ENV=${LB_ENV:-${DFT_LB_ENV}}

# If volume was used with images older than v2, then archive useless files
pushd /config
Expand All @@ -57,7 +59,11 @@ popd
# No configuration file inside the volume
if ! [ -f /config/config.php ]; then
echo "Initialize file config.php"
cp /var/www/html/config/config.dist.php /config/config.php
if [ "${LB_ENV}" = "dev" ]; then
cp /var/www/html/config/config.devel.php /config/config.php
else
cp /var/www/html/config/config.dist.php /config/config.php
fi
chown www-data:www-data /config/config.php
sed \
-i /config/config.php \
Expand Down

0 comments on commit e958ae6

Please sign in to comment.