Reduce and optimize Ruby on Rails, PostgreSQL Docker Image size
Building small docker containers can improve performance in builds/pulls and security of the application. It’s easy to start reducing the size of your rails docker image by utilizing small base images and the multi-stage builds pattern.
Prerequisites
Docker
Docker is a tool to build safer, share wider, run faster: New updates to our product subscriptions.
you should add a .dockerignore file to your code base, which works pretty much the same way the .gitignore file does. In addition to copying over the contents of your .gitignore file, you might want to include the .git/ directory as well to the list of files ignored by Docker.
Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications. Read more about Alpine Linux here - https://alpinelinux.org/about/ and you can see how their mantra fits in right at home with Docker images.
1 2
FROM ruby:alpine # FROM ruby:3.0.2-alpine
Multi-stage Builds
Multistage builds are useful to anyone who has struggled to optimize Dockerfiles while keeping them easy to read and maintain.
With multi-stage builds, you use multiple FROM statements in your Dockerfile. Each FROM instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don’t want in the final image. To show how this works, let’s adapt the Dockerfile from the previous section to use multi-stage builds.
MapStruct is a code generator that greatly simplifies the implementation of mappings between Java bean types based on a convention over configuration approach.
The generated mapping code uses plain method invocations and thus is fast, type-safe and easy to understand.
Posted onEdited onInRaspberry PiWord count in article: 2.8kReading time ≈3 mins.
K3S on Raspberry Pi
K3S is the certified Kubernetes distribution built for IoT & Edge computing.
Raspberry Pi 4 Model (or B) is your tiny, dual-display, desktop computer …and robot brains, smart home hub, media centre, networked AI core, factory controller, and much more.
Elastic APM is the free and open application performance monitoring. It monitor, detect, and diagnose complex application performance issues to maintain an expected level of service.
This article is about how to use Pulumi, kubernetes (K8S) provider, Helm Chart and TypeScript SDK to deploy Elastic APM within Kubernetes (K8S).
Elastic Kibana is a free and open user interface that lets you visualize your Elasticsearch data and navigate the Elastic Stack. Do anything from tracking query load to understanding the way requests flow through your apps.
This article is about how to use Pulumi, kubernetes (K8S) provider, Helm Chart and TypeScript SDK to deploy Elastic Kibana within Kubernetes (K8S).
Elasticsearch is the distributed, RESTful search and analytics engine at the heart of the Elastic Stack. You can use Elasticsearch to store, search, and manage data for:
Logs
Metrics
A search backend
Application monitoring
Endpoint security
… and more!
This article is about how to use Pulumi, kubernetes (K8S) provider, Helm Chart and TypeScript SDK to deploy Elasticsearch within Kubernetes (K8S).
Visual Studio Code Java, Spring, Spring Boot extensions
Visual Studio Code is an ideal lightweight development environment for Spring Boot application developers and there are several useful VS Code extensions including:
The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java Application Programming Interface (API).
Once you have the extension installed, open the Command Palette (⇧⌘P) and type Spring Initializr to start generating a Maven or Gradle project and then follow the wizard.