Maksym Prokopov
Personal blog powered by a passion for technology.

Keycloak

01.01.0001
docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:11.0.3

Pharo testing

01.01.0001

Suprisingly, Pharo turns out to be interesting solution for managing web pages fully by the pure OO classes and objects.

Ruby tricks

01.01.0001

Use binding object to run code within other object context.
https://ruby-doc.org/core-2.2.0/Binding.html

stderr output

highlight your code and insert in presentation

https://gist.github.com/jimbojsb/1630790

Speeding up Ruby on Rails in docker

01.01.0001

Speeding up Ruby on Rails in docker

  1. Bundle package will create a cached copy, so bundler in docker will not fetch all dependencies all the time.

bundle package

  1. Create separate bundler data volume to perisist bundle between builds. Set BUNDLE_PATH to data volume. You can include this option just for development docker-compose.yml file and not to include in production.

version: “2” services: memcached: image: memcached networks: — back-tier redis: image: redis ports: [“6379”] networks: — back-tier db: image: mysql:5 volumes: — ./sql:/docker-entrypoint-initdb.d — mysql:/var/lib/mysql networks: — back-tier sse: image: mprokopov/sse build: context: sse/. command: “bundle exec rackup — host 0.0.0.0 — port 9292” environment: — RACK_ENV=production ## docker database settings in config.yml ports: — “9292:9292” links: — redis — db depends_on: — db — redis networks: — back-tier — front-tier worker: image: mprokopov/itservice_web_dev command: “bundle exec rake environment resque:work” environment: — QUEUE=* links: — db — redis depends_on: — db — redis networks: — back-tier worker-schedule: image: mprokopov/itservice_web_dev command: “bundle exec rake environment resque:scheduler” links: — db — redis depends_on: — redis networks: — back-tier search: image: mprokopov/itservice_search build: ./search volumes: — search-data:/search depends_on: — db links: — db networks: — back-tier expose: — “9306” web: ports: — “3000:3000” environment: — LETTER_OPENER=letter_opener_web — RAILS_SERVE_STATIC_FILES=true — SLACK_NOTIFICATION=false — EMAIL_NOTIFICATION=false — SLACK_WEBHOOK_CHANNEL=#events_test — STREAM_API=http://localhost:9292 depends_on: — db — redis links: — db — redis — search networks: — back-tier — front-tier volumes: — search-data:/search volumes: search-data: mysql: networks: back-tier: front-tier:

Read More…

Useful Kubernetes tools and tips

01.01.0001

Unlike docker-compose sometimes kubectl provides you better tooling for docker container access.

Let me share with you my useful findings.

With port-forward, you can easily connect to pods service and debug it.

kubectl port-forward podname port

For example

kubectl port-forward sharepass-78d566f866-4dvv5 3000

kubectl port-forward sharepass-78d566f866–4dvv5 3000
Forwarding from 127.0.0.1:3000 -> 3000
Forwarding from [::1]:3000 -> 3000
Handling connection for 3000
Handling connection for 3000

This will forward port 3000 to localhost, so you can open URL http://localhost:3000 and enjoy access to your service.

Read More…

Why is my dev docker container so slow on macOS?

01.01.0001

TLDR: because of the networking layer and how docker volumes implemented.