{"id":15725853,"url":"https://github.com/ndrean/docker-slim","last_synced_at":"2026-04-04T08:43:27.535Z","repository":{"id":124424676,"uuid":"380721981","full_name":"ndrean/docker-slim","owner":"ndrean","description":"Slim Rails images, Rails/Sidekiq/ActionCable-standalone/Nginx with Docker-Compose \u0026 Kubernetes (StatefulSet Postgres \u0026 Redis)","archived":false,"fork":false,"pushed_at":"2021-09-05T05:30:46.000Z","size":12264,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T06:46:06.813Z","etag":null,"topics":["actioncable","docker","kubernetes","postgresql","preact","rails","redis","sidekiq","websockets"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ndrean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-27T11:25:44.000Z","updated_at":"2021-08-27T02:38:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcecb36d-25e3-4848-b290-225783b61933","html_url":"https://github.com/ndrean/docker-slim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndrean%2Fdocker-slim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndrean%2Fdocker-slim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndrean%2Fdocker-slim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndrean%2Fdocker-slim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ndrean","download_url":"https://codeload.github.com/ndrean/docker-slim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246402582,"owners_count":20771341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actioncable","docker","kubernetes","postgresql","preact","rails","redis","sidekiq","websockets"],"created_at":"2024-10-03T22:24:36.326Z","updated_at":"2025-12-30T20:28:27.388Z","avatar_url":"https://github.com/ndrean.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Explanations\n\n\u003chttps://dev.to/ndrean/realtime-rails-with-websockets-1jk3\u003e\n\n## Branches\n\n- Deployed on Heroku: \u003chttps://pg-redis-cable-sdq.herokuapp.com\u003e, but without Sidekiq (2 free dynos only).\n\n- master \u003c=\u003e run with `overmind start -f Procfile.overmind`\n\n- dock-dev \u003c=\u003e run `docker-compose up --build`\n\n- docker-prod \u003c=\u003e build images and run `docker-compose up --build`\n\n- Kubernets/Minikube \u003c=\u003e start Minikube and run Tilt\n\n## Initialize the PostgreSQL database\n\n- modifiy **/config/database.yml** (or **.env**) to pass to the Postgres adapter the desired user/password: `POSTGRES_URL=postgresql://bob:bobpwd@localhost:5432/k8_development`\n\n- run in a terminal:\n\n```sh\nRAILS_ENV=development rails rails db:drop rails:prepare\n```\n\n- connect to PostgreSQL to create ROLE 'bob' with password \"bobpwd\"\n\n```sql\npsql -U postgres\n# get list of databases\n\\l\n# connect to the desired database\n\\c k8_development\nCREATE ROLE bob WITH SUPERUSER CREATEDB LOGIN PASSWORD 'bobpwd';\n```\n\nSame database name for `primary` and `replica`:\n\nInitialize ElephantSQL database:\n\n```sql\nCREATE TABLE counters (\n  id bigserial PRIMARY KEY,\n  nb integer,\n  created_at timestamp,\n  updated_at timestamp\n);\n```\n\n## Run `overmind`\n\nThe app is running locally with hot static assets replacement and Rails running in dev mode (page refresh will update the app). Run `overmind start` to start the four processes _rails_, _webpack-dev-server_, _redis_ and _sidekiq_:\n\nThe following runs on OSX (use \"redis-server /usr/local/etc/redis.conf\" on OSX, and \"/usr/local/etc/redis/redis.conf\" on Linux ):\n\n```txt\nassets:  ./bin/webpack-dev-server\nweb:     bundle exec rails server\nredis-server:   redis-server /usr/local/etc/redis.conf\nworker:  bundle exec sidekiq -C config/sidekiq.yml\ncable: bundle exec puma -p 28080 cable/config.ru\n```\n\n## The Redis database\n\nModify **/usr/local/etc/redis/redis.conf** with `requirespass secretpwd`.\n\nOnce the app is running (ie **redis-server** is up), we can check that Redis is protected by the password by connecting to the redis-cli:\n\n```sh\nredis-cli\n127.0.0.1:6379\u003e GET counter\n(error) NOAUTH Authentication required\n127.0.0.1:6379\u003e AUTH secretpwd\nOK\n127.0.0.1:6379\u003e GET counter\n23\n```\n\nWe can setup Redis with AOF and RDB.\n\n## Gem **sidekiq_alive**\n\n\u003chttps://github.com/arturictus/sidekiq_alive_example\u003e\n\n\u003chttps://github.com/mhfs/sidekiq-failures\u003e\n\n\u003chttps://github.com/mperham/sidekiq/wiki\u003e\n\n## Example Rackup\n\nDeclared a controller \"Example_Controller\" inheriting from ApplicationController::Base\nThen \"config.ex.ru\" and launched with:\n\"bundle exec puma -b tcp://0.0.0.0:3001 config.ex.ru\"\n\n=\u003e this is used for cable with `/cable/config.ru` to run a standalone Cable.\n\n## Nginx\n\n```sh\n cp nginx/k8nginx.conf /usr/local/etc/nginx/servers/\n nginx -s stop \u0026\u0026 nginx\n```\n\nThe config will pass the web sockets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndrean%2Fdocker-slim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndrean%2Fdocker-slim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndrean%2Fdocker-slim/lists"}