should buildshould build

This commit is contained in:
Jeffrey Paul 2019-12-07 21:46:17 -08:00
parent 21ee1776b5
commit bf6a0dc199
8 changed files with 34 additions and 19 deletions

View File

@ -3,10 +3,14 @@ FROM phusion/baseimage:0.11
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
ADD setup.sh /tmp/setup.sh
# install os prereq stuff to image
ADD prereqs.sh /tmp/prereqs.sh
RUN bash /tmp/prereqs.sh
# install stuff to image
RUN bash /tmp/setup.sh
# install mastodon:
ADD install.sh /tmp/install.sh
RUN chpst -u mastodon:mastodon bash /tmp/install.sh
ADD ./rootfs /

26
install.sh Normal file
View File

@ -0,0 +1,26 @@
#!/bin/bash
export HOME="/mastodon"
export PATH="$HOME/.rbenv/bin:$PATH"
export RUBY_CONFIGURE_OPTS="--with-jemalloc"
git clone https://github.com/rbenv/rbenv.git $HOME/.rbenv
cd $HOME/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $HOME/.bashrc
echo 'eval "$(rbenv init -)"' >> $HOME/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
eval "$(rbenv init -)"
rbenv install 2.6.1
rbenv global 2.6.1
gem update --system
gem install bundler --no-document
git clone https://github.com/tootsuite/mastodon.git /mastodon/app
cd /mastodon/app
# v3.0.1:
git checkout c4118ba71ba31e408c02d289e111326ccc6f6aa2
bundle install \
-j$(getconf _NPROCESSORS_ONLN) \
--deployment --without development test
yarn install --pure-lockfile

View File

@ -61,20 +61,5 @@ apt install -y \
yarn \
zlib1g-dev
addgroup -g 991 mastodon
addgroup --gid 991 mastodon
useradd --uid 991 --gid 991 -m -d /mastodon mastodon
exit 0
su - mastodon <<'EOF'
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.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

View File

View File

View File

View File

View File