# Mautic 5.+ Docker php-fpm/nginx update image

**URL:** https://forum.mautic.org/t/mautic-5-docker-php-fpm-nginx-update-image/33578
**Category:** Mautic 5 Install/Upgrade Support
**Created:** [September 23, 2024, 9:26am UTC](https://forum.mautic.org/t/mautic-5-docker-php-fpm-nginx-update-image/33578 "2024-09-23T09:26:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kingfisher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kingfisher/32/12783_2.png) [@kingfisher](https://forum.mautic.org/u/kingfisher)
#### Post date: [September 23, 2024, 9:26am UTC](https://forum.mautic.org/t/mautic-5-docker-php-fpm-nginx-update-image/33578/1 "2024-09-23T09:26:34Z")

</div>

**Your software**  
My Mautic version is: 5.1.0  
My PHP version is: fpm-8.1  
My Database type and version is: 11.3.2-MariaDB

**Your problem**  
My problem is:

Following the official [example](https://github.com/mautic/docker-mautic/tree/mautic5/examples/fpm-nginx) for using Mautic 5 with docker we try to update from 5.1.0 to 5.1.1 by updating the provided image.

Starting over with the docker compose up -d the mautic containers are recreated but the Mautic version is still 5.1.0. Deleting the Docker volume `docroot` and restarting the Docker stack recreates `docroot` with all files and the new Mautic version is active and working.

We do not understand how the update strategy for Mautic on Docker using php-fpm/nginx is. We need to automate the update process in pipelines and always removing the `docroot` volume is not an option althogh keeping `media/files|images` in separate volumes. Could someone please explain how the proper way is to update Mautic in Docker with php-fpm/nginx?

Thank you!

These errors are showing in the log:

./.

Steps I have tried to fix the problem:

Deleting Docker volume `docroot`.

Running bin/console mautic:update and mautic:update --finish results in the install workflow in the UI.

---

<div class="post-metadata">

### Author: ![kingfisher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kingfisher/32/12783_2.png) [@kingfisher](https://forum.mautic.org/u/kingfisher)
#### Post date: [September 23, 2024, 11:26am UTC](https://forum.mautic.org/t/mautic-5-docker-php-fpm-nginx-update-image/33578/2 "2024-09-23T11:26:40Z")

</div>

I just tested the “basic example” with Apache – the update from 5.1.0 to 5.1. works by just pulling the new image and recreating the container on base of the new image.

It doesn’t work with the Nginx example image.

The difference between the two examples is that in the Apache version, “docroot” is located internally in the container, not on in a volume, because apache is running as a service internally and with Nginx, “docroot” must be an external disk because Nginx needs to access certain assets from “docroot”.

It remains unclear how Mautic handles the files in `docroot` or why it does not update the files from `docroot` when they are located on a volume.

---

<div class="post-metadata">

### Author: ![kingfisher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kingfisher/32/12783_2.png) [@kingfisher](https://forum.mautic.org/u/kingfisher)
#### Post date: [September 24, 2024, 11:58am UTC](https://forum.mautic.org/t/mautic-5-docker-php-fpm-nginx-update-image/33578/3 "2024-09-24T11:58:50Z")

</div>

We worked further on this topic and understand that the fact that docroot is in an volume it is overlaying the docroot folder in the Mautic image. The image is providing the updated docroot but the old files are still in the volume.

This is so obvious that we did not see it 🙂 We where expecting some magic Mautic copy voodoo…

Our solution is to create a docroot volume dedicated for the nginx container which is populated by rsync in entrypoint.sh of the mautic\_web container.

This works now like expected. A statement about that topic in the Readme - mautic container does not update with the nginx/php-fpm example configuration - would be helpful for others i think.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)
#### Post date: [September 25, 2024, 11:59pm UTC](https://forum.mautic.org/t/mautic-5-docker-php-fpm-nginx-update-image/33578/4 "2024-09-25T23:59:20Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
