-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Is your feature request related to a problem? Please describe.
Magic automatically stops containers when using the test runtime, but since apps, especially in development, crash often or the user presses Ctrl+C, we can't really shut them down after the app has been stopped.
On top of this, the container running in the background is often convenient when you want to, for example, take a peek into the database.
Describe the solution you'd like
We should keep the fact that the container stays alive in the background, but actually provide proper tools to shut the containers down without having to go through Docker. For deletion as well.
Magic already provides some flags like --profile <name> to run in a certain profile. Scripts work the same way as well.
For this reason, we should introduce the following new flags to the CLI (we also already have the logic for properly handling such flags):
# Shutdown all containers
%binary% --shutdown
# Execute an instruction (clear tables, drop tables, etc.)
# If no name is provided, a TUI will be opened where you can choose what instruction to execute.
%binary% --instructions <name> # Alias: -i
# Delete all containers, volumes and everything completely (also .magic folder)
%binary% --m-resetProfile and more should work with all flags except for --reset just like normal. If not specified, the default profile should be used.
Additional context
This would be really nice as I've been shutting the containers down in Docker Desktop the entire time. And that gets a little annoying after a while. But I don't want them gone completely. In fact, it would be cool, if in the future, we would also consider adding stuff like getting bash access in a container using a simple flag.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status