-
The Great Docker Logging Mystery: When 21KB Messages Become 8KB Chunks

Picture this: You’re monitoring your production logs, everything seems normal, until you notice something odd. Your application is processing large JSON messages—some pushing 21KB—but when you check the Docker logs, they’re mysteriously chopped into neat 8KB pieces. The data is there, but fragmented across multiple log lines, turning your structured logging into a debugging nightmare.…
-
Proof of Concept: Dynamic Runtime Configuration with s6 Overlay Using Environment Variables

In the world of containerized applications, managing runtime configurations efficiently is crucial for ensuring flexibility, scalability, and maintainability. One of the challenges developers face is how to dynamically configure services based on the environment in which the container is running. This article explores a proof of concept (PoC) that demonstrates how to define runtime configurations…
-
Prevent Kubernetes Pod Restarts: Graceful Worker Shutdown and Auto-Restart with Signal Handling

In modern cloud-native environments, containers have become the backbone for running services at scale. Kubernetes, in particular, excels at orchestrating containerized applications. One common scenario in such setups is running long-lived worker processes that consume messages from a queue, such as a Symfony Messenger worker. Pros of containerized workers: However, there are some downsides: In…
-
Secure Your Git Commits: A Guide to GPG Signing

Git commit signing with GPG keys adds an extra layer of security and authenticity to your code contributions. This guide will walk you through the process of setting up GPG signing for your Git commits and troubleshoot common issues. Setting Up GPG Signing for Git Commits 1. Create and publish your GPG Key 2. List…
-
Store GPG keys with Bitwarden

GPG (GNU Privacy Guard) is a free, open-source software tool for secure communication and data protection. It implements the OpenPGP standard, allowing users to encrypt and sign their data and communications. GPG uses public-key cryptography, enabling users to exchange messages securely without sharing secret keys beforehand. It’s widely used for securing email, verifying software distributions,…
-
Enhancing Code Reliability with PHP’s `in_array()` Function: A Deep Dive into Strict Type Comparison

PHP’s in_array() function is a versatile tool for searching values within an array. By default, it performs a loose comparison, which can sometimes lead to unexpected results. However, this blog post aims to shed light on the often overlooked third boolean argument of in_array(), which allows for strict type comparison. We’ll explore the benefits and…
-
Optimizing MySQL Queries for data synchronization script

Today I’d like to share with you an episode of MySQL queries optimization. Deploying an application that grows over time implies some refactoring for components or logic that no longer scales or becomes a bottleneck of performance for the app, which might affect at some point the health of the system. This kind of refactoring…
-
Using composer with unpublished packages

Want to test your hashtag#php packages before you publish them on hashtag#Packagist? Or are you using hashtag#private repositories for your hashtag#packages and still want to use hashtag#Composer to manage them as hashtag#dependencies? Here is a detailed approach on how you can achieve this.
-
S6 v3 for PHP (+ Caddy/Nginx)
Have you tried to setup an S6 supervisor for the official PHP Docker image, just to realize that something does not work right? Like, the S6 does not react to container termination command? Here’s what happened to me. The context My initial setup was a docker-compose.yml configuration file with php as backend service, and nginx…
-
PHP is DEAD!
Why You Should Use PHP in 2019? Before we start… PHP stands for Hypertext Preprocessor, and it is a general-purpose, free and open-source scripting language, primarily used for web development as it can be embedded into HTML. It is a script language, meaning that, compared to compiled code, the PHP code is interpreted instead. Line…