diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7101d17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM ruby:2.7-alpine +WORKDIR /myapp +COPY Gemfile /myapp/Gemfile +COPY Gemfile.lock /myapp/Gemfile.lock +COPY config.ru /myapp/config.ru +COPY server.rb /myapp/server.rb +COPY style.css /myapp/style.css + +RUN apk add make +RUN apk add gcc +RUN apk add musl-dev +RUN bundle install +EXPOSE 9292 +CMD bundle exec puma diff --git a/INSTALL.md b/INSTALL.md index bfeae2d..a377932 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,3 +1,5 @@ +# The true way + You'll need ruby and redis installed to run this. If you're on a mac, one way to go getting redis is to install [homebrew](https://brew.sh/), then run `brew install redis`. Then, for ruby, install [rvm](https://rvm.io/). Once ruby + redis are installed you can just run `redis-server` in a terminal to start redis. @@ -12,3 +14,24 @@ bundle exec puma Now you should be able to just visit localhost:9292 in your browser to see the chat. Open it in a few windows to chat between them! The web server tries, by default, to talk to redis using its default settings. If you need to specify different redis config details, create a .env file containining `REDIS_URL=redis://somehost:someport`. Alternately, provide `REDIS_URL` as an environment variable when running puma, like `REDIS_URL=redis://somehost:someport bundle exec puma`. + +# The docker way + +If you came here to run this chat, please, re-evaluate your life choices. Ok, done? + +This server has been dockerized for the sake of Gambiconf 2021 https://gambiconf.dev/. As a good dockerization, just run `docker-compose up` and you will be served fine. + +## Troubleshooting + +For some unknown reason, my `dockerd` inside my Hyper-V couldn't solve https://rubygems.org/, so to workaround it I touch another DNS to the daemon: + +```bash +$ cat > /etc/docker/daemon.json <