Deploy Bookstack to Azure App Service (docker)

This guide is very simple.

All you need to deploy a fresh version of Bookstack to Azure App Service are two things:

1) Azure CLI

Follow this guide for the CLI installation:

How to install the Azure CLI | Microsoft Learn

Follow this guide for creating all the resources you need via CLI:

https://learn.microsoft.com/en-us/azure/container-instances/container-instances-quickstart?WT.mc_id=UI_empg

Basically, you can create the resource group and app service plan (linux) using the CLI and also the GUI.

2) Docker Compose File.

The docker compose file in this repo seem not to work fine without fine-tuning.

linuxserver/docker-bookstack: A Docker container for the BookStack documentation wiki (github.com)

I have fine-tuned the docker compose file to use MySQL rather than maria and also changed the volumes.

Don't forget to change the name of your intended Azure App Service.

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: password
       MYSQL_DATABASE: bookstackapp
       MYSQL_USER: bookstack
       MYSQL_PASSWORD: password

   bookstack:
     depends_on:
       - db
     image: lscr.io/linuxserver/bookstack
     ports:
       - "6875:80"
     restart: always
     environment:
       APP_URL: https://webapp-name.azurewebsites.net
       DB_USER: bookstack
       DB_HOST: db:3306
       DB_PASS: password
       DB_DATABASE: bookstackapp
       DB_CONNECTION: mysql
volumes:
    db_data:

Ensure Azure CLI is functioning.

Run the following command to create the app service:

az webapp create --resource-group 'resource-group-name' --plan 'app-service-plan-name' --name 'webapp-name' --multicontainer-config-type compose --multicontainer-config-file docker-compose.yml

The app service will start and you'll see the bookstack login page.