diff --git a/beeper/etc/containers/systemd/mastodon/mastodon-darkhttpd.container b/beeper/etc/containers/systemd/mastodon/mastodon-darkhttpd.container new file mode 100644 index 0000000..9b5b2a6 --- /dev/null +++ b/beeper/etc/containers/systemd/mastodon/mastodon-darkhttpd.container @@ -0,0 +1,17 @@ +[Unit] +Description=Mastodon DarkHTTPD Static Server +After=network-online.target +Wants=network-online.target + +[Container] +Image=p3terx/darkhttpd +Exec=/mastodon/public/system +PublishPort=192.168.1.73:42261:80 +Volume=/var/containers/mastodon/public/system:/mastodon/public/system:z + +[Service] +Restart=always +RestartSec=10s + +[Install] +WantedBy=default.target diff --git a/beeper/etc/containers/systemd/mastodon/mastodon-dfdb.container b/beeper/etc/containers/systemd/mastodon/mastodon-dfdb.container new file mode 100644 index 0000000..ff66b7b --- /dev/null +++ b/beeper/etc/containers/systemd/mastodon/mastodon-dfdb.container @@ -0,0 +1,23 @@ +[Unit] +Description=Mastodon Dragonfly DB + +[Container] +Image=docker.dragonflydb.io/dragonflydb/dragonfly +Environment=DFLY_snapshot_cron=* * * * * +Environment=DFLY_version_check=false +Environment=DFLY_default_lua_flags=allow-undeclared-keys +Environment=DFLY_dbfilename=dump.rdb +Environment=DFLY_df_snapshot_format=false +Environment=DFLY_dir=/data +HealthCmd=redis-cli ping +HealthInterval=5s +HealthRetries=20 +Network=mastodon.network +Volume=/var/containers/mastodon/dragonfly:/data:z + +[Service] +Restart=always +RestartSec=10s + +[Install] +WantedBy=default.target diff --git a/beeper/etc/containers/systemd/mastodon/mastodon-ingress.container b/beeper/etc/containers/systemd/mastodon/mastodon-ingress.container new file mode 100644 index 0000000..a7fe80e --- /dev/null +++ b/beeper/etc/containers/systemd/mastodon/mastodon-ingress.container @@ -0,0 +1,18 @@ +[Unit] +Description=Mastodon Ingress Service +Requires=postgresql.service mastodon-dfdb.service +After=postgresql.service mastodon-dfdb.service + +[Container] +Image=ghcr.io/synth-download/mastodon-ingress:nightly +EnvironmentFile=/var/containers/mastodon/.env.secrets +EnvironmentFile=/var/containers/mastodon/.env +Network=mastodon.network +Network=postgresql.network + +[Service] +Restart=always +RestartSec=10s + +[Install] +WantedBy=default.target diff --git a/beeper/etc/containers/systemd/mastodon/mastodon-sidekiq.container b/beeper/etc/containers/systemd/mastodon/mastodon-sidekiq.container new file mode 100644 index 0000000..7c9e871 --- /dev/null +++ b/beeper/etc/containers/systemd/mastodon/mastodon-sidekiq.container @@ -0,0 +1,21 @@ +[Unit] +Description=Mastodon Sidekiq Service +Requires=postgresql.service mastodon-dfdb.service +After=postgresql.service mastodon-dfdb.service + +[Container] +Image=ghcr.io/synth-download/mastodon:nightly +EnvironmentFile=/var/containers/mastodon/.env.secrets +EnvironmentFile=/var/containers/mastodon/.env +Exec=bundle exec sidekiq +HealthCmd=ps aux | grep '[s]idekiq 7' || false +Network=mastodon.network +Network=postgresql.network +Volume=/var/containers/mastodon/public/system:/mastodon/public/system:z + +[Service] +Restart=always +RestartSec=10s + +[Install] +WantedBy=default.target diff --git a/beeper/etc/containers/systemd/mastodon/mastodon-streaming.container b/beeper/etc/containers/systemd/mastodon/mastodon-streaming.container new file mode 100644 index 0000000..77630b8 --- /dev/null +++ b/beeper/etc/containers/systemd/mastodon/mastodon-streaming.container @@ -0,0 +1,21 @@ +[Unit] +Description=Mastodon Streaming Service +Requires=postgresql.service mastodon-dfdb.service +After=postgresql.service mastodon-dfdb.service + +[Container] +Image=ghcr.io/synth-download/mastodon-streaming:nightly +EnvironmentFile=/var/containers/mastodon/.env.secrets +EnvironmentFile=/var/containers/mastodon/.env +Exec=node ./streaming/index.js +HealthCmd=curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1 +Network=mastodon.network +Network=postgresql.network +PublishPort=192.168.1.73:58834:4000 + +[Service] +Restart=always +RestartSec=10s + +[Install] +WantedBy=default.target diff --git a/beeper/etc/containers/systemd/mastodon/mastodon-web.container b/beeper/etc/containers/systemd/mastodon/mastodon-web.container new file mode 100644 index 0000000..69c7381 --- /dev/null +++ b/beeper/etc/containers/systemd/mastodon/mastodon-web.container @@ -0,0 +1,24 @@ +[Unit] +Description=Mastodon Web Service +Requires=postgresql.service mastodon-dfdb.service +After=postgresql.service mastodon-dfdb.service + +[Container] +Image=ghcr.io/synth-download/mastodon:nightly +EnvironmentFile=/var/containers/mastodon/.env.secrets +EnvironmentFile=/var/containers/mastodon/.env +Exec=bundle exec puma -C config/puma.rb +HealthCmd=curl -s --noproxy localhost localhost:3000/health | grep -q 'OK' || exit 1 +Network=mastodon.network +Network=postgresql.network +PublishPort=192.168.1.73:46098:3000 +Volume=/var/containers/mastodon/public/system:/mastodon/public/system:z +Volume=/var/containers/mastodon/init/disable_ssl.rb:/mastodon/config/initializers/disable_ssl.rb:ro,z +Volume=/var/containers/mastodon/shared:/shared:z + +[Service] +Restart=always +RestartSec=10s + +[Install] +WantedBy=default.target diff --git a/beeper/etc/containers/systemd/mastodon/mastodon.network b/beeper/etc/containers/systemd/mastodon/mastodon.network new file mode 100644 index 0000000..264f70a --- /dev/null +++ b/beeper/etc/containers/systemd/mastodon/mastodon.network @@ -0,0 +1 @@ +[Network] diff --git a/beeper/etc/containers/systemd/postgresql/postgresql.container b/beeper/etc/containers/systemd/postgresql/postgresql.container new file mode 100644 index 0000000..f8aa713 --- /dev/null +++ b/beeper/etc/containers/systemd/postgresql/postgresql.container @@ -0,0 +1,20 @@ +[Unit] +Description=PostgreSQL Database + +[Container] +Image=groonga/pgroonga:latest-alpine-17 +EnvironmentFile=/var/containers/postgresql/.env +Network=postgresql.network +HealthCmd=pg_isready -U postgres -d postgres +HealthInterval=40s +HealthTimeout=3s +HealthRetries=20 +Volume=/var/containers/postgresql/db:/var/lib/postgresql/data:z +Volume=/var/containers/postgresql/exp:/mnt/exp:z + +[Service] +Restart=always +RestartSec=10s + +[Install] +WantedBy=default.target diff --git a/beeper/etc/containers/systemd/sharkey/sharkey-activity.container b/beeper/etc/containers/systemd/sharkey/sharkey-activity.container index 93ff599..d2857f4 100644 --- a/beeper/etc/containers/systemd/sharkey/sharkey-activity.container +++ b/beeper/etc/containers/systemd/sharkey/sharkey-activity.container @@ -1,7 +1,7 @@ [Unit] Description=Sharkey's ActivityPub Federation service -Requires=sharkey-dfdb.service -After=sharkey-dfdb.service network-online.target +After=postgresql.service sharkey-dfdb.service network-online.target +Requires=postgresql.service sharkey-dfdb.service Wants=network-online.target [Container] diff --git a/beeper/etc/containers/systemd/sharkey/sharkey-api.container b/beeper/etc/containers/systemd/sharkey/sharkey-api.container index eb3fe31..a2508bf 100644 --- a/beeper/etc/containers/systemd/sharkey/sharkey-api.container +++ b/beeper/etc/containers/systemd/sharkey/sharkey-api.container @@ -1,7 +1,7 @@ [Unit] Description=Sharkey's API and Web service -Requires=sharkey-dfdb.service -After=sharkey-dfdb.service network-online.target +After=postgresql.service sharkey-dfdb.service network-online.target +Requires=postgresql.service sharkey-dfdb.service Wants=network-online.target [Container] diff --git a/beeper/etc/containers/systemd/sharkey/sharkey-media.container b/beeper/etc/containers/systemd/sharkey/sharkey-media.container index 950cec7..67e74af 100644 --- a/beeper/etc/containers/systemd/sharkey/sharkey-media.container +++ b/beeper/etc/containers/systemd/sharkey/sharkey-media.container @@ -1,7 +1,7 @@ [Unit] Description=Sharkey's Media service -Requires=sharkey-dfdb.service -After=sharkey-dfdb.service network-online.target +After=postgresql.service sharkey-dfdb.service network-online.target +Requires=postgresql.service sharkey-dfdb.service Wants=network-online.target [Container] diff --git a/beeper/etc/containers/systemd/sharkey/sharkey-worker.container b/beeper/etc/containers/systemd/sharkey/sharkey-worker.container index ac52c98..537a489 100644 --- a/beeper/etc/containers/systemd/sharkey/sharkey-worker.container +++ b/beeper/etc/containers/systemd/sharkey/sharkey-worker.container @@ -1,7 +1,7 @@ [Unit] Description=Sharkey's Worker service -After=sharkey-dfdb.service network-online.target -Requires=sharkey-dfdb.service +After=postgresql.service sharkey-dfdb.service network-online.target +Requires=postgresql.service sharkey-dfdb.service Wants=network-online.target [Container]