linuxazuredockerazure-web-app-serviceghost

Persisting content across docker restart within an Azure Web App


I'm trying to run a ghost docker image on Azure within a Linux Docker container. This is incredibly easy to get up and running using a custom Docker image for Azure Web App on Linux and pointing it at the official docker hub image for ghost.

Unfortunately the official docker image stores all data on the /var/lib/ghost path which isn't persisted across restarts so whenever the container is restarted all my content get's deleted and I end up back at a default ghost install.

Azure won't let me execute arbitrary commands you basically point it at a docker image and it fires off from there so I can't use the -v command line param to map a volume. The docker image does have an entry point configured if that would help.

Any suggestions would be great. Thanks!


Solution

  • You have a few options:

    1. You could mount a file share inside the Docker container by creating a custom image, then storing data there. See these docs for more details.
    2. You could switch to the new container instances, as they provide volume support.
    3. You could switch to the Azure Container Service. This requires an orchestrator, like Kubernetes, and might be more work than you're looking for, but it also offers more flexibility, provides better reliability and scaling, and other benefits.