kkuchta/css-only-chat

Docker needed

Opened this issue · 2 comments

Please dockerize your application for ease of use.

I have done it.

Dockerfile:

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

And because it needed also redis and I have no idea how it works nor how to setup it, docket-compose.yml:

version: "3.9"
services:
  css-chat:
    build: .
    ports:
      - "9292:9292"
    links:
      - redis
    environment:
      REDIS_URL: redis://redis
  redis:
    image: redis:6-alpine

It worked for me. I am no docker expert but, hey, the docker in my hyper-v got this and I could open my app in my Windows browser

It works perferctly, thank you!