Save stack compose without updating the stack
Is your feature request related to a problem? Please describe. Often I modify a single service inside my stack (Env, Label, ...) and want to persist this change inside the stack's compose file, but I don't want to re-deploy the whole stack and restart all services.
Describe the solution you'd like A simple "Save file" button next to the "Update the stack" button.
Describe alternatives you've considered You can edit the file directly inside portainer's volume but via portainer's UI would be so much easier.
Additional context
Mockup:

Hi @gbhrdt
Updating a single service in the stack file and hitting update the stack should normally redeploy the updated service only and not all the services in the stack.
Based on this behavior, I'm not sure that this feature request is actually needed.
Anthony,
I have wished I could do that as well. Though it is more so I can stage a production change before the outage window and then just select the services during the outage window and update them.
Though the ability to designate a blue/green deployment would be another solution to the issue.
@cyberlink1 how is it related to the ability to save a stack without deploying it? What prevents you from preparing the changes and using the "Update the stack" button during the outage window?
@deviantony You're totally right, the services are not all being restarted. But there are still cases (like @cyberlink1 said) where you want to "prepare" changes to the stack file in portainer before updating the stack. I use the portainer compose editor heavily and sometimes I have stuff to change at the compose files (e.g. some new ENV vars) but don't want to restart the associated service. So what I miss is the ability to prepare those stack changes directly in portainer.
@cyberlink1 how is it related to the ability to save a stack without deploying it? What prevents you from preparing the changes and using the "Update the stack" button during the outage window?
Make the changes during the day at work, then shutdown the laptop and deploy the changes in the evening during the outage window. If you cant save it, it will not be there later.
Though thinking about this and mulling it over I wonder if it would be better to be able to save to and pull the stack yaml from a repo like gitlab. At least that way there would be a way to back them up should you also have the issue in #2731
Maybe related to https://github.com/portainer/portainer/issues/1753 instead of #2731 ?
Adding on my two cents about this feature request. This missing functionality really surprised me. How can I stage changes to multiple stacks, but only commit them later when in a maintenance window? Sometimes it's just a small correction to the name of an output file, backup setting, etc and I'm fine if it just gets picked up the next time the stack is restarted for another reason. I can't make a change, save it for later, and change another stack. I'm stuck on that Editor screen until I either abandon the changes or update the stack.
Same functionality as the button we already have but leaves out the step to update the affected services. Seems straightforward?
EDIT: Another related issue: updating the stack always automatically starts the stack, even if the stack was stopped when the edit was made. Then I'm forced to wait the screen to refresh, then stop the stock.
I'm a little sick about this... always copying/pasting/editing docker-compose settings and config in order to avoid to do all that during a maintenance window.
It is useful though to see the exact configuration actually running, so the original config should be visible elsewhere, while the one I see in the editor should be editable without beeing forced to restart everything.
Hi there,
To keep this open request alive: if I might add : it would be very nice if we could create "drafts" at some points without redeploying. Quite frequently and especially during prep work, I would like to save some modifications without deploying and it's not possible.
So +1 for this functionality! 😉
Another reason why this would be good is for people who uses a compose set up where they also type in their username and password into the compose file. Being able to erase that part and save it as "changeme" or the like helps it not just sit there.
Also surprised this does not exist- i was trying to build / setup a new docker environment (and this time use entertainer), and didnt want to deploy yet.
also the specific app was setting up needed 2x separate docker-compose files, thus i wanted to save both, setup their proper environmental vars, and then when i was ready, deploy them. (but i dont see where that is possible in portainer)
Do I miss this feature in the GUI or isn't it in yet?
:+1:
Do I miss this feature in the GUI or isn't it in yet?
it still does not exist yet- It's not clear why, but one still has to deploy or re-deploy anytime editing a compose file in portainer. (unfortunate in my opinion, and hopefully this will change) , If I had the coding skills to implement this I would issue a PR with changes.
One use-case where this is frustrating: if for example one needs to simply add a comment (# xyz) to their compose file in portainer you have to either start up that entire stack or restart an already running stack just to add in that comment
+1
plz take care on this topic. it ist very important to save changes without deploy immediately. Sometimes changes are already made in the Docker and for documentation or later reinstall some kind of e.g. Environment variables are added, but no need to deploy, just saving would be enough!
Sometimes is useful to take a look at other stack files to copy some values from them or get a reference to be able to finish creating a new one, other times it could be useful to "inspect" the file to make sure the env vars I used were added properly. I currently cannot do so without losing my changes for the new stack file, it's odd that this functionality isn't there already considering that the files do get saved when deployed, it seems it's just a matter of providing a button that calls the "save file" function that should already exist.
+1
+1 We need to be able to stage changes ... I am literally updating the stack to add a comment, so I do not really need any containers restarted.
+1 or simply add a toggle that exposs compose's --no-start flag, to recreate the containers without starting them
I often make changes to containers that are not running (as I run them when they are needed) and it is annoying that they all start every time I have to update the stack