Why does FluentSnippet inside a Dokploy Docker stack require a manual "docker restart" to sync code changes?
Hi!
I'm hosting a production wp site via Dokploy on VPS using Multi-Container Docker Compose stack and currently migrating my clients website from Cloud Hosting to their own VPS
I'm facing a massive caching deadlock with the fluentsnippets plugin, and here i need architectural advice on how to properly solve this.
My setup:
Panel: Dokploy running a RAW compose
Webserver: Nginx
App Container: Alpine PHP-FPM
Cache/DB Layer: Redis Alpine container (WP_CACHE=true enabled) + MariaDB 10.6
The shared storage: Host Docker Named Volume (wordpress_data) mapped to /var/www/html.
My problem right now:
- Whenever i use FluentSnippets to edit, rename, or change the group of the code block inside the wp-admin, nothing changes on the UI, the old code state remain frozen.
- The ONLY thing that worked to sync it is manually through SSH "docker restart" command
Obviously forcing a full container reboot every time just to update a piece of snippet is sounds like a joke.
What i've tried:
- OPcache is locked hard - the custom docker image default to PHP_OPCACHE__VALIDATE=0, so i change to =1, but because of FluentSnippets uses an atomic swap mechanism to save files (writing temporart file in /tmp, unlinking the old one and renaming the new one into place), the Linux inode number changes, the Alpine PHP-FPM pool loses track of it in shared memory (shm)
- Permission Restriction - Programmatic code attemps using opcache_reset(1) or triggering process reloads like shell__exec ('kill -USR 1') fail silently because the unprivileged web use www-data inside the Alpine runtime does not have root access to signal PID1
- REST API out of sync - even if we invalidate specific files, fluentsnippets used custom endpoints (/wp-json/fluent-snippents/) to render the list views. The metadata is stored in DB as CPT, but it gets agressively cached by the Redis Container and likely falls into Nginx fastCGI cachiny layer.
My question -
Sorry if i post in the wrong place, im looking for answers everywhere but cant find one. I've tried mu-plugin to flush redis, action delayed, inject cache-control headers but still not syncs it on wp-admin.
Please let me know if anyone facing the same issues and how to fix it. Thanks!
heard you. The main issue is, FluentSnippets is file based snippet manager so you opcache can't reload the files when it's got changed. So we have add patch for opcache. It should work now from 10.55 version.
You may not get updates right now as WP has now 24 hours security review. But you can download from here and try and let me know if that works or not: https://wordpress.org/plugins/easy-code-manager/
Hi Shahjahan,
Wow, thank you so much for the quick response and the hotfix! That makes total sense now. Our VPS is running on Docker via Dokploy, and the OPcache configuration is indeed very aggressive, which explains why the file-based changes weren't reloading yesterday.
I've manually downloaded and tested version 10.55 on our environment. I can confirm that the OPcache invalidation patch completely resolved the issue! The changes are now synced in milliseconds without any delays or issues. It works perfectly!
Really appreciate the lightning-fast, top-notch support! You can safely roll out this update for everyone. π