With Azure App Services supporting mounting of storage accounts, I managed to get this project working in Azure App Services as a Docker container, using a mounted storage account. There’s some manual setup involved and requires copying files, but it appears to be working fine. In the future there may be a more robust method to do this, but in the meantime…
- Create an Azure App Service, choosing the Container type, and use the
strapi/strapi:latestas the image name. Once it is created, Stop the app service.
- Create an Azure Storage account, choosing Standard or Premium, just make sure it’s a StorageV2 type.
- In the newly created Storage Account, create a private container, name whatever you want.
- On the Azure App Service, go to Configuration -> Path Mappings, select the Storage account from step 2, and the container name from step 3.
- Have your database setup (MongoDB, MySQL, Postgres, whatever)
- On your local machine with Docker installed, run the following (assuming Mac/Linux, make appropriate path changes for Windows)
docker run -it -p 1337:1337 (pass all of your database parameters here as well) -v /tmp/app:/srv/app strapi/strapi:latest
- After it builds everything, it serves up the app on port 1337. You can go to localhost:1337 now to setup your admin user to verify your database connection is good. If database connections are failing, check your
- Stop the container (Ctrl-C)
azcopyor another method to transfer files to the Storage Account, copy your installed files to your Storage Account container, example:
azcopy copy '/tmp/app/*' 'https://yourstorageaccountname.blob.core.windows.net/containerNameFromStep4' --recursive
- Once that is complete, Start your app service. After a bit of time, it should load up the site and you should be good to go.