-
In my use case, we are not familiar with changing template each time, so I would like to keep the container there when stopping, and restart the container when starting, instead creating a new one. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
You should look at mounting volumes to persist your workspace directories. See this template for example. https://github.com/matifali/coder-templates/blob/main/deeplearning/main.tf |
Beta Was this translation helpful? Give feedback.
-
I added BUT, if I don't stop the container after stopping the workspace, and start the workspace, wired things happen, unable to connect (the ui keeps loading, Probably, coder should stop all container when stopping a workspace? By the way, I see nothing related to stopping a container in terraform docs. Probably terraform simply doesn't support stopping a container? Can anyone tell me is that correct? |
Beta Was this translation helpful? Give feedback.
-
You cannot persist a container on workspace stop. Even if you somehow prevent terraform from destroying it it will be recreated/replaced on the next workspace restart. |
Beta Was this translation helpful? Give feedback.
You cannot persist a container on workspace stop. Even if you somehow prevent terraform from destroying it it will be recreated/replaced on the next workspace restart.
For persistence you should mount volumes to the directories you need.