Welcome to the second post in my data stack setup journey! š My goal is to hustle through setting up all the components so I can get to the good stuff: data and analytics engineering.
But first, I need a documentation server, because, letās be realāIām already forgetting where Iāve documented things. š
What is Bookstack?
BookStack describes itself as a “simple, self-hosted, easy-to-use platform for organizing and storing information.” I like to think of it as: a wiki thatās easy to host, simple to back up, and doesnāt make you cry.
What are you using this for?
BookStack is my documentation layer in the data stack. Hereās what I plan to use it for:
- Network configurations
- Initial data catalog repository
- Notes and configs for everything Iām doing
Basically, itās where my brain will live when it canāt keep up. š§
Is Bookstack the best option for documentation?
Honestly? I have no idea. It works for me, and the price is right! (Spoiler: itās free.)
If youāre looking for the definitive guide to all things documentation, this isnāt it. Move along. š
Okay whatever, so how are doing this?
Iām using Docker Compose for pretty much everything. Back in the day, I tried installing tools directly on bare metal. It was a pain to maintain and update.
Docker Compose changed the game. Infrastructure as code? Yes, please.
Will you explain how to setup docker and what docker compose and does?
No.
Great.
It is great, you should check it out!
For this setup, Iām using the official LinuxServer.io BookStack Docker image.
The documentation is pretty great. Hereās the base Docker Compose configuration from their docs:
|
|
The first thing that sticks out to me is that this image requires a database (that isn’t included). Reading through the documentation BookStack needs a MySQL-compatible database, but one isnāt included in the image. Enter: MariaDB (the first database in this journey).
Now I have a decision to make:
- Add the database to the same
docker-compose.yaml
file. - Set up a separate database container for future reuse.
Since I need this documentation server running yesterday, Iām going with option 1. Letās flex those Docker skills. šŖ
Adding the database: MariaDB š¢ļø
LinuxServer.io suggests their MariaDB image, so letās roll with it:
|
|
Stitching it together š§µ
Hereās what Iām adding to the docker-compose.yaml
file:
- Environment variables
- The
depends_on
property so BookStack waits for the database to be ready - A
healthcheck
to ensure MariaDB finishes initializing before BookStack tries to connect
Hereās the final docker-compose.yaml
:
|
|
Environment Variables: .env
File
To keep things tidy, Iām storing all sensitive info in a .env
file:
|
|
Running the containers
With the docker-compose.yaml
and .env
files in place, itās time to fire it up:
|
|
Well…. Something’s gone wrong.
Checking the logs, I find this gem:
|
|
No worriesāI run the command to generate the key, update the .env
file, and try again.
Success! š
And there it is: my shiny new BookStack instance, up and running.
Next stop: Probably airflow! Maybe. š¤ļø