Lower the stack
$ grim down
The end of a working day, or the moment another project needs the memory. grim down stops the containers of the project you are standing in and removes them. Nothing you would miss goes with them: what a container needs to keep lives in a volume, and volumes are left alone.
It works on one project. The Traefik that routes every .test domain on the machine belongs to all of them, so it keeps running.
Usage
$ grim down # stop this project, keep its volumes
$ grim down --volumes # stop it and delete what the volumes heldRun it from the project directory. Anywhere else it has no grim.json to go by and says so.
Arguments and options
Stop Docker services
Usage
grim down [--volumes]Options
| Option | Description |
|---|---|
--volumes |
Remove volumes (docker compose down -v) |
What it actually does
Three things, in this order.
- Stops Vite. The dev server
grim upstarted runs on your machine, not in a container, so Docker would never stop it. Left alone it keeps its port and the nextgrim upfinds it taken. - Removes
public/hot. That file tells the app to load assets from the dev server. With Vite gone it would point every page at nothing. - Runs
docker compose down. Containers and the project network are removed. With--volumesit isdocker compose down -v.
What --volumes takes with it
That depends on where the project runs, because the database does not live in the same place everywhere.
| Where | In a volume | --volumes costs you |
|---|---|---|
| Your machine | Redis | Cache, sessions and queued jobs. The database runs on the machine itself, outside the stack, and is not touched. |
| A shared dev box | MySQL and Redis | The project's whole database, for everyone who works on that box. |
There is no prompt and no way back except a dump made earlier. On a dev box, ask before you run it. It is a way to a clean slate on purpose, not a fix for a container that will not start.
After it finishes
Nothing of the project is running and nothing is lost. grim up brings it back as it was. After --volumes the same grim up starts the stack with empty volumes.
Related spells
grim up
Raise the stack
Start the project's containers and its Vite dev server, with a trusted certificate and a working address, and say where to open it.
grim reload
Apply a changed .env
Recreate every container of the project and clear the config cache, so the app reads the .env as it is now.
grim logs
Read the logs
Show what the containers have been printing, for one service or all of them, on your machine or on a deployed server.