From 21ee1776b5575d2bce4f88acccf64543ad6d562c Mon Sep 17 00:00:00 2001 From: sneak Date: Sat, 7 Dec 2019 21:10:21 -0800 Subject: [PATCH] initial --- Dockerfile | 17 ++++++++++++ Makefile | 4 +++ README.md | 13 +++++++++ setup.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 README.md create mode 100644 setup.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a43b1a9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM phusion/baseimage:0.11 + +# Use baseimage-docker's init system. +CMD ["/sbin/my_init"] + +ADD setup.sh /tmp/setup.sh + +# install stuff to image +RUN bash /tmp/setup.sh + +ADD ./rootfs / + +RUN chmod +x /usr/local/bin/* /etc/service/*/run + +VOLUME /state + +EXPOSE 3000 4000 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0652912 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +default: build + +build: + docker build -t sneak/mastodon . diff --git a/README.md b/README.md new file mode 100644 index 0000000..25fb5e6 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# true single-container mastodon + +don't ever host things anywhere but on your own domain. + +this violates all the docker best practices and puts the whole-ass app inside a single container (including redis and postgres!) so that you can easily bring up a sef-hosted mastodon on things like caprover in a single "app" without having to worry about cross-container links. + +i really just wanted a one-command single-user mastodon. + +# credits + +all praise to wonderfall's single-container mastodon: + +https://github.com/Wonderfall/docker-mastodon diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..5536d7a --- /dev/null +++ b/setup.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +set -x + +export DEBIAN_FRONTEND=noninteractive + +MRUM="main restricted universe multiverse" +M="mirror://mirrors.ubuntu.com/mirrors.txt" +cat > /etc/apt/sources.list <> ~/.bashrc +echo 'eval "$(rbenv init -)"' >> ~/.bashrc +source ~/.bashrc +git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build +RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.6.1 +rbenv global 2.6.1 +gem update --system +gem install bundler --no-document +EOF