tsoding / tsoder

Twitch Bot for Morning Tsoding streams
https://www.twitch.tv/tsoding
MIT License
4 stars 1 forks source link

How to properly manager state persistence in the Docker environment. #80

Closed rexim closed 7 years ago

rexim commented 7 years ago

Right now it is recommended to start the docker image with --rm https://github.com/tsoding/tsoder/blob/80200fed590230982321e8c8a0d209f540bf63fa/README.md#docker which removes the container after application shutted down. But the state is persisted on the file system, and removing container removes the state as well.

We need to come up with a better approach.

rexim commented 7 years ago

Just keep it in the container. Create container like so:

$ docker build -t tsoder .
$ docker run -e ACCESS_TOKEN="<access-token>" --name morning_tsoding tsoder

To start the container:

$ docker start morning_tsoding

To stop the container:

$ docker stop morning_tsoding

The state is always in the container.

@rexim document this approach in the README

rexim commented 7 years ago

Another question is how to properly backup such container?