diff --git a/Dockerfile b/Dockerfile index baf83a75049aeaedea74629b7421cee76167ab83..f2a2150fff3d8cc0e34fe7c0170531b4bf3b7625 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,32 +31,9 @@ RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A170311380 RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - RUN apt-get install -y nodejs && npm install -g yarn -# Install rvm -COPY ./qoto/.ruby-version .ruby-version -RUN read RUBY_VERSION < .ruby-version -RUN rm .ruby-version -RUN curl -sSL https://raw.githubusercontent.com/rvm/rvm/stable/binscripts/rvm-installer | bash -s stable --ruby=$RUBY_VERSION -COPY rvm-reinstall.sh rvm-reinstall.sh -RUN bash rvm-reinstall.sh && rm rvm-reinstall.sh - # Configure database RUN /etc/init.d/postgresql restart && /etc/init.d/postgresql status && sudo -u postgres createuser -U postgres vagrant -s && sudo -u postgres createuser -U postgres root -s && sudo -u postgres createdb -U postgres mastodon_development -# Install gems and node modules -#RUN gem install bundler foreman -#RUN bundle install -#RUN yarn install - -#RUN apt remove cmdtest yarn -y && apt-get install npm -y && npm install -g yarn -#RUN apt-get install npm -y && npm install -g yarn - -#RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -#RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -#RUN echo "deb https://nightly.yarnpkg.com/debian/ nightly main" | tee /etc/apt/sources.list.d/yarn.list -#RUN apt-get install yarn -y - -#RUN update-rc.d postgresql enable - # Run the command on container startup EXPOSE 3000 ENV BIND="0.0.0.0" diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d93843c9442fdbfd621f904b2ce7f6c409e629f3 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +Just run the following: + +docker run -p 3000:3000 --volume="/path/to/qoto:/qoto" qotoorg/qoto-test + +This will determine what version of ruby the mastodon repo needs, install it into the container, then run bundle and yarn install, setup a database, setup redis and then run the server at http://localhost:3000 diff --git a/entrypoint.sh b/entrypoint.sh index 30a93372f8b8d814c342742015d1902ea399b5ea..171cad99780b3a775500abcec8c5c3c31a761081 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,18 @@ #!/bin/bash +read RUBY_VERSION < /qoto/.ruby-version +curl -sSL https://raw.githubusercontent.com/rvm/rvm/stable/binscripts/rvm-installer | bash -s stable --ruby=${RUBY_VERSION} + source /usr/local/rvm/scripts/rvm -rvm use ruby-2.6.1 --default + +# Install Ruby +rvm reinstall ruby-$RUBY_VERSION --disable-binary +#rvm install ruby-2.6.1 --disable-binary +rvm use ruby-$RUBY_VERSION --default +#rvm use ruby-2.6.1 --default +gem install bundler foreman + +rvm use ruby-$RUBY_VERSION --default cd /qoto diff --git a/rvm-reinstall.sh b/rvm-reinstall.sh deleted file mode 100644 index 2e32845282337595a88532ab98de286dddc23864..0000000000000000000000000000000000000000 --- a/rvm-reinstall.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -source /usr/local/rvm/scripts/rvm - -# Install Ruby -#rvm reinstall ruby-$RUBY_VERSION --disable-binary -rvm install ruby-2.6.1 --disable-binary -#rvm use ruby-$RUBY_VERSION --default -rvm use ruby-2.6.1 --default -gem install bundler foreman