$ git clone --recursive git://github.com/tsoding/tsoder.gitBot for Tsoding streams
$ ./scripts/create_db.erl /tmp/tsoder.mnesia/ # initializing database (see config/sys.config)
$ ACCESS_TOKEN="<twitch-access-token>" TSODER_CHANNEL="<twitch-channal>" rebar3 shell --name tsoder@nodeIf you use NixOS we have a default.nix file at the root of the project for you to make your life easier.
$ rebar3 eunit$ docker build -t tsoder .
$ docker create -e ACCESS_TOKEN="<access-token>" \
-e TSODER_CHANNEL="<channel-name>" \
--name morning-tsoding tsoder
$ docker start -a morning-tsoding
$ docker stop morning-tsodingTsoder Docker Image has a volume at /tmp/tsoder.mnesia/ (see Dockerfile for more details) where the application keeps its database. The Dockerfile script creates the /tmp/tsoder.mnesia folder and initializes Mnesia database inside of it with the ./scripts/create_db.erl script. But if you want to constantly backup your database it is recommended to initialize the Mnesia database outside of the Docker Image manually with ./scripts/create_db.erl script:
$ ./scripts/create_db.erl ./tsoder.mnesia/And bind mount the external folder to /tmp/tsoder.mnesia/ volume on the container creation:
$ docker create -e ACCESS_TOKEN="<access-token>" \
-e TSODER_CHANNEL="<channel-name>" \
-v /absolute/path/to/tsoder.mnesia/:/tmp/tsoder.mnesia/ \
--name morning-tsoding tsoder