Dockerfile and docker-compose configuration for Booked scheduling package.
The version of Booked to use for building can be specified using the VERSION
build arg (set this to git
to build the latest git master), but if you don't need to change anything you can simply pull from docker hub: docker pull mkdryden/docker-booked
(this defaults to 2.8.5).
To rebuild the git
build, you should also set the CACHEBUST
build arg to make sure the git repo is freshly cloned, e.g., --build-arg VERSION=git --build-arg CACHEBUST==$(date +%s)
.
The docker-compose.yml
file is set up to run a basic configuration.
Many options found in config.php can be configured using environment variables and some important ones are already listed in docker-compose.yml
(see Dockerfile
for the full list).
Note that if you change any options under Application Configuration from the web UI, it will no longer be possible to set them using environment variables until you remove and recreate the container.
If you prefer, you can use volumes to expose config.php
directly and set options that way. (It can be found in /var/www/booked/config/config.php
)
Running docker-compose up
will start a normal configuration including a docker-booked
container (php-fpm
) for booked, a mysql
container for database storage, and nginx
as web server, open on port 80.
nginx can be configured using the site.conf
file (e.g., if you want to set up HTTPS).
At a minimum, BOOKED_WEB_URL
and BOOKED_INSTALL_PASSWORD
should be configured in docker-compose.yml
.
BOOKED_WEB_URL
should point to the URL at which the container can be reached (including the Web
directory).
BOOKED_INSTALL_PASSWORD
is a random password used during installation. (It can be autogenerated for you if you leave it blank)
When the containers are up, go to http://<your hostname>/Web/install
and follow the instructions to set up the database.
When it asks for the password, give it BOOKED_INSTALL_PASSWORD
(if you left it blank, it will autogenerate one you can paste into docker-compose.yml
, but you will need to restart the container.).
When it asks for a database user and password, use the values of BOOKED_DATABASE_USER
(default: booked_user) and BOOKED_DATABASE_PASSWORD
(default: password).
Leave the options for creating the database and user unselected as these are taken care of by the mysql container.
When you click Run Installation, it can take a few minutes (it may even time out in your browser, but be patient and reload), but when it is complete, your site should be up and running.
If you chose to load sample data, you can log in with user admin
and password password
, otherwise the first user you make will have admin permissions.
By default, the compose configuration uses deck-chores to perform the background jobs listed here for Booked.
Note that this requires accessing your docker socket from the officer
container and I'm not sure what happens if you're already running deck-chores in a different container.
If you prefer, you can simply comment out the container in docker-compose.yml
and either live without the background jobs or else trigger them manually with e.g., a cron job using docker-compose exec
.
There is a bug in the SQL query in sendmissedcheckin.php
that prevents sending missed checkin emails that the Dockerfile patches around, but if it ever gets fixed, it might break the Dockerfile.