Meeseeker on Docker

in utopian-io •  6 years ago  (edited)

Along with 0.0.3 release, you can now use docker to kick off meeseeker.

Related commit:

https://github.com/inertia186/meeseeker/commit/4b4312ba453ec04529de443f763526e7548f8259

This will launch meeseeker in a docker container, so you can immediately attach to it on port 6380.

docker run -d -p 6380:6379 inertia/meeseeker:latest
redis-cli -p 6380

What Changed

What I did was add a Dockerfile to the project, which uses FROM redis. This means that my docker image imports everything from the redis image.

The Basic Image

After basically cloning the redis image, I have it install the packages I need, like a system version of ruby provided by apt-get:

FROM redis

ENV APP_ROOT /meeseeker
WORKDIR /meeseeker

# Dependencies
RUN \
    apt-get update && \
    apt-get install -y \
        curl \
        bzip2 \
        build-essential \
        libssl-dev \
        libreadline-dev \
        zlib1g-dev \
        ruby \
        ruby-dev

Dependencies

After we have ruby, using RUN gem update --system tells our system version of gem not to worry that I'm, running as root, which suppresses a warning when we do the next step of RUN gem install bundler, which installs the bundler utility.

Bundler is used to install the dependencies of meeseeker. Once those dependencies are installed, the docker image is ready.

RUN gem update --system
RUN gem install bundler

# copy in everything from repo
COPY . .

RUN chmod +x /meeseeker/bin/meeseeker

RUN bundle config --global silence_root_warning 1
RUN bundle install

Meanwhile, in the Container ...

The final step is to ask docker to put the image onto our docker container, which is performed with docker run above. This will actually execute the final CMD and EXPOSE statements in the Dockerfile:

CMD /usr/local/bin/redis-server --daemonize yes && bundle exec rake sync

EXPOSE 6379

Recap

So, the whole point of this Dockerfile is to get us to the final rake sync. We need all these prerequisites to happen first and docker handles this nicely.


Flexibility

You can also pass any of the environment variables meeseeker accepts. For example, this will launch meeseeker with custom_json.id channels enabled, but only keeps ops around for 5 minutes:

docker run \
  --env MEESEEKER_PUBLISH_OP_CUSTOM_ID=true \
  --env MEESEEKER_EXPIRE_KEYS=300 \
  -d -p 6380:6379 inertia/meeseeker:latest

Also see: https://hub.docker.com/r/inertia/meeseeker/



Previous posts:

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  • Good progress for the project to be using docker.
  • I like your previous post section idea.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @helo! Keep up the good work!

Congratulations @inertia! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 23000 upvotes. Your next target is to reach 24000 upvotes.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Support SteemitBoard's project! Vote for its witness and get one more award!

Hi, @inertia!

You just got a 1.5% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hi @inertia!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

This post has been included in the latest edition of SoS Daily News - a digest of all you need to know about the State of Steem.

Hey, @inertia!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!