diff --git a/README.md b/README.md index 74d75d6..2c3b45e 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,46 @@ The dockerfile builds a container that uses [feed2toot](https://feed2toot.readth * `feed2toot_usercred.txt`: from `register_feed2toot_app` script * `feed2toot_cache.db`: cache file to register previous posts +Docker image was built like this and pushed to registry: +``` +docker build -t registry.greenbaum.cloud/library/mastodon-hackernews-feed2toot:0.0.1 . +docker push registry.greenbaum.cloud/library/mastodon-hackernews-feed2toot:0.0.1 +``` + +Initial deployment, just for documentation, **don't run this for updates**: +``` +# Run the steps from Deployment of updates section +# After initial deployment, copy secrets and cache file to volume mounted on /data +❯ find . -name 'feed2toot*' -type f +./feed2toot.ini +./secrets/feed2toot_clientcred.txt +./secrets/feed2toot_cache.db +./secrets/feed2toot_usercred.txt + +❯ for FILE in $(find . -name 'feed2toot*' -type f -printf "%f\n"); \ + do \ + docker cp ./secrets/$FILE bot_mastodon-hackernews-feed2toot_1:/data/$FILE; \ + done +❯ docker cp ./feed2toot.ini bot_mastodon-hackernews-feed2toot_1:/data/feed2toot.ini + +# Uncomment external option of volume +``` + +Deployment of updates: +1. Get [tritonshell](https://git.greenbaum.cloud/dev/tritonshell) +2. Enter `tritonshell` for DC `cgn-1` +``` +cd tritonshell +nix develop --command $SHELL +eval "$(triton env cgn-1-pub_solar)" +cd .. + +# Optional +# Check for running container +docker ps -a | grep mastodon-hackernews-feed2toot +``` + +3. Update running container to a new version +``` +docker-compose --project-name bot up --detach +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b136f89 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "2.4" + +services: + mastodon-hackernews-feed2toot: + image: registry.greenbaum.cloud/library/mastodon-hackernews-feed2toot:0.0.1 + mem_limit: 128m + restart: always + network_mode: My-Fabric-Network + volumes: + - mastodon-hackernews-feed2toot:/data + +volumes: + mastodon-hackernews-feed2toot: + # Uncomment this after volume creation + external: true + name: mastodon-hackernews-feed2toot + driver: tritonnfs + driver_opts: + size: "10G" + labels: + - volumename=mastodon-hackernews-feed2toot