<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Yannick Pereira-Reis · Posts</title><description>Platform engineer. Resume and technical writing about platform engineering, CI/CD, Kubernetes, observability and developer experience.</description><link>https://ypereirareis.github.io/</link><language>en</language><item><title>Running cron jobs in Docker containers: the definitive guide</title><link>https://ypereirareis.github.io/posts/running-cron-jobs-docker-container-definitive-guide/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/running-cron-jobs-docker-container-definitive-guide/</guid><description>Cron jobs in Docker often fail silently. Every step to make them run: syslog, file names, file owner, environment variables and mail.</description><pubDate>Thu, 09 Apr 2020 00:00:00 GMT</pubDate><category>platform</category><category>operations</category></item><item><title>How to join Prometheus metrics by label with PromQL</title><link>https://ypereirareis.github.io/posts/how-to-join-prometheus-metrics-by-label-with-promql/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/how-to-join-prometheus-metrics-by-label-with-promql/</guid><description>When aggregating metrics from many sources or exporters in a Prometheus database, we often need to JOIN metrics on labels.</description><pubDate>Fri, 21 Feb 2020 00:00:00 GMT</pubDate><category>operations</category></item><item><title>Reduce Nginx 502 errors with dynamic DNS resolution</title><link>https://ypereirareis.github.io/posts/how-to-reduce-nginx-502-bad-gateway-errors-risks-with-dynamic-domain-name-resolution/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/how-to-reduce-nginx-502-bad-gateway-errors-risks-with-dynamic-domain-name-resolution/</guid><description>Restarting PHP-FPM during a deployment often triggers Nginx 502 Bad Gateway errors. Dynamic name resolution for proxy_pass and fastcgi_pass avoids them.</description><pubDate>Tue, 18 Feb 2020 00:00:00 GMT</pubDate><category>infrastructure</category><category>architecture</category></item><item><title>Why split your env files with Docker Compose and Swarm</title><link>https://ypereirareis.github.io/posts/why-you-should-split-env-file-with-docker-compose-docker-swarm-stack-and-services/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/why-you-should-split-env-file-with-docker-compose-docker-swarm-stack-and-services/</guid><description>One .env file shared by all services restarts every container on each change. Split it per service with Docker Compose and Docker Swarm.</description><pubDate>Mon, 28 Oct 2019 00:00:00 GMT</pubDate><category>architecture</category><category>platform</category></item><item><title>Docker and PHP-FPM truncated logs: workaround</title><link>https://ypereirareis.github.io/posts/php-fpm-truncated-log-workaround-solution-trick/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/php-fpm-truncated-log-workaround-solution-trick/</guid><description>PHP-FPM 7.0 to 7.2 truncates log lines written to stdout/stderr in Docker containers. Here is the workaround, and the fix shipped with PHP 7.3.</description><pubDate>Tue, 30 Jul 2019 00:00:00 GMT</pubDate><category>operations</category><category>platform</category></item><item><title>Doing a (301) redirect with HAPROXY without cache</title><link>https://ypereirareis.github.io/posts/haproxy-301-redirect-without-cache/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/haproxy-301-redirect-without-cache/</guid><description>You are on the good page if you want to know how to do a redirect without cache with haproxy</description><pubDate>Tue, 04 Jun 2019 00:00:00 GMT</pubDate><category>infrastructure</category></item><item><title>Get the real client IP in Nginx behind HAProxy</title><link>https://ypereirareis.github.io/posts/real-client-ip-address-nginx-behind-haproxy-reverse-proxy/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/real-client-ip-address-nginx-behind-haproxy-reverse-proxy/</guid><description>Behind HAProxy, Nginx only sees the proxy IP. Forward and trust the client address to log and use the real IP of your users.</description><pubDate>Tue, 04 Jun 2019 00:00:00 GMT</pubDate><category>infrastructure</category></item><item><title>MySQL DELETE with GROUP BY and HAVING</title><link>https://ypereirareis.github.io/posts/mysql-delete-group-by-having/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/mysql-delete-group-by-having/</guid><description>MySQL DELETE does not support GROUP BY and HAVING. Combine GROUP_CONCAT and FIND_IN_SET to delete the matching rows in a single command.</description><pubDate>Fri, 02 Mar 2018 00:00:00 GMT</pubDate><category>development</category></item><item><title>Vue.js two-way data binding with Vuex and strict mode</title><link>https://ypereirareis.github.io/posts/vuejs-two-way-data-binding-state-management-vuex-strict-mode/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/vuejs-two-way-data-binding-state-management-vuex-strict-mode/</guid><description>Two-way data binding is easy with Vue.js, but v-model on store state breaks Vuex strict mode. Use computed properties and mutations instead.</description><pubDate>Tue, 25 Apr 2017 00:00:00 GMT</pubDate><category>development</category></item><item><title>RabbitMQ highly available cluster with docker and HAProxy</title><link>https://ypereirareis.github.io/posts/rabbitmq-high-available-cluster-haproxy-docker/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/rabbitmq-high-available-cluster-haproxy-docker/</guid><description>A docker stack to simulate a RabbitMQ cluster with high availability. HAProxy for load balancing, multi nodes, nodes failure, network partition,...</description><pubDate>Mon, 03 Apr 2017 00:00:00 GMT</pubDate><category>architecture</category><category>infrastructure</category></item><item><title>PHP fpm and cli error log configuration</title><link>https://ypereirareis.github.io/posts/php-fpm-cli-error-log/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/php-fpm-cli-error-log/</guid><description>Logging errors is something essential. Let&apos;s see how to do it with php-fpm (and cli)</description><pubDate>Mon, 20 Feb 2017 00:00:00 GMT</pubDate><category>operations</category></item><item><title>Get the real user IP in Nginx behind an Nginx reverse proxy</title><link>https://ypereirareis.github.io/posts/nginx-real-ip-behind-nginx-reverse-proxy/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/nginx-real-ip-behind-nginx-reverse-proxy/</guid><description>Behind a reverse proxy, Nginx only sees the proxy IP. Configure the realip module to log and use the real IP address of your users.</description><pubDate>Wed, 15 Feb 2017 00:00:00 GMT</pubDate><category>infrastructure</category></item><item><title>Nginx: redirect HTTP to HTTPS and non-www to www</title><link>https://ypereirareis.github.io/posts/nginx-redirect-http-to-https-non-www-to-www/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/nginx-redirect-http-to-https-non-www-to-www/</guid><description>Nginx configuration to redirect HTTP to HTTPS and non-www to www URLs, for security and to avoid duplicate content between both hosts.</description><pubDate>Tue, 14 Feb 2017 00:00:00 GMT</pubDate><category>infrastructure</category><category>security</category></item><item><title>How to write a good Docker entry point</title><link>https://ypereirareis.github.io/posts/docker-how-to-write-good-entry-point/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/docker-how-to-write-good-entry-point/</guid><description>The one rule every Docker entry point must follow: it must not fail when run twice, because a restarted container keeps its previous state.</description><pubDate>Wed, 28 Sep 2016 00:00:00 GMT</pubDate><category>platform</category></item><item><title>Local, remote and dynamic port forwarding with SSH tunnels</title><link>https://ypereirareis.github.io/posts/ssh-tunnel-local-remote-port-forwarding/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/ssh-tunnel-local-remote-port-forwarding/</guid><description>Use SSH tunnels to reach databases and services on a remote network, expose a local machine from outside, or run a SOCKS proxy.</description><pubDate>Mon, 19 Sep 2016 00:00:00 GMT</pubDate><category>infrastructure</category><category>security</category></item><item><title>docker-machine with the generic driver and devicemapper</title><link>https://ypereirareis.github.io/posts/docker-machine-generic-driver-devicemapper/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/docker-machine-generic-driver-devicemapper/</guid><description>What to configure and check to control a remote Docker daemon with docker-machine, using the generic driver and the devicemapper storage driver.</description><pubDate>Thu, 12 May 2016 00:00:00 GMT</pubDate><category>infrastructure</category></item><item><title>Doctrine tip: type hint parameters so MySQL uses indexes</title><link>https://ypereirareis.github.io/posts/doctrine-parameters-type-hint-tip-mysql-index/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/doctrine-parameters-type-hint-tip-mysql-index/</guid><description>A badly typed DQL parameter can stop MySQL from using an index. See why type hinting Doctrine query parameters matters on large tables.</description><pubDate>Tue, 29 Mar 2016 00:00:00 GMT</pubDate><category>development</category></item><item><title>MySQL INSERT IGNORE alternatives</title><link>https://ypereirareis.github.io/posts/mysql-insert-ignore-alternatives/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/mysql-insert-ignore-alternatives/</guid><description>INSERT IGNORE INTO or REPLACE INTO MySQL operations are not really good practices. I advise you to replace with something else to INSERT if not exists.</description><pubDate>Tue, 22 Mar 2016 00:00:00 GMT</pubDate><category>development</category></item><item><title>Symfony client for a JWT API secured with LexikJWT</title><link>https://ypereirareis.github.io/posts/symfony-lexikjwtauthenticationbundle-client-user-authenticator-provider/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/symfony-lexikjwtauthenticationbundle-client-user-authenticator-provider/</guid><description>A Symfony client (firewall, authenticator, user provider and user model) consuming an API protected by JWT tokens and LexikJWTAuthenticationBundle.</description><pubDate>Wed, 16 Mar 2016 00:00:00 GMT</pubDate><category>development</category><category>security</category></item><item><title>Wrap Doctrine operations in a transaction, the easy way</title><link>https://ypereirareis.github.io/posts/symfony-doctrine-transactional-code-made-easy/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/symfony-doctrine-transactional-code-made-easy/</guid><description>Several database operations in one request or command should run in a transaction. A small helper wraps them in a callable, with rollback on failure.</description><pubDate>Fri, 11 Mar 2016 00:00:00 GMT</pubDate><category>development</category></item><item><title>Use environment variables in a crontab inside Docker</title><link>https://ypereirareis.github.io/posts/docker-crontab-environment-variables/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/docker-crontab-environment-variables/</guid><description>Cron jobs do not see the environment variables of a Docker container. Here is a simple way to export them so crontab scripts can use them.</description><pubDate>Mon, 29 Feb 2016 00:00:00 GMT</pubDate><category>platform</category></item><item><title>Doctrine automatic table prefix</title><link>https://ypereirareis.github.io/posts/doctrine-automatic-table-prefix-symfony/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/doctrine-automatic-table-prefix-symfony/</guid><description>Always prefix your tables with a prefix to avoid naming conflicts. You can do this automatically with doctrine.</description><pubDate>Thu, 18 Feb 2016 00:00:00 GMT</pubDate><category>development</category></item><item><title>Docker image size optimization</title><link>https://ypereirareis.github.io/posts/docker-image-size-optimization/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/docker-image-size-optimization/</guid><description>Simple tricks to shrink Docker images: layer caching, minimal base images like Alpine or BusyBox, fewer layers and removing useless files.</description><pubDate>Mon, 15 Feb 2016 00:00:00 GMT</pubDate><category>platform</category></item><item><title>Symfony 3 upgrade fixer and deprecation detector</title><link>https://ypereirareis.github.io/posts/symfony-upgrade-fixer-deprecation-detector-docker/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/symfony-upgrade-fixer-deprecation-detector-docker/</guid><description>To upgrade a Symfony project to Symfony 3, some people built different tools to help us</description><pubDate>Wed, 10 Feb 2016 00:00:00 GMT</pubDate><category>development</category></item><item><title>Composer, Satis and docker</title><link>https://ypereirareis.github.io/posts/composer-satis-docker-satisfy/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/composer-satis-docker-satisfy/</guid><description>Thanks to Composer, Satis, satisfy and docker it&apos;s really easy to host and use private git repositories</description><pubDate>Thu, 28 Jan 2016 00:00:00 GMT</pubDate><category>platform</category></item><item><title>Symfony dynamic services with the expression language</title><link>https://ypereirareis.github.io/posts/symfony-dynamic-services-expression-language/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/symfony-dynamic-services-expression-language/</guid><description>Create and inject Symfony services dynamically, depending on the environment or on environment variables, with the expression language.</description><pubDate>Mon, 25 Jan 2016 00:00:00 GMT</pubDate><category>development</category></item><item><title>Symfony environment variables with Nginx and PHP-FPM</title><link>https://ypereirareis.github.io/posts/symfony-nginx-environment-variables-php-fpm/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/symfony-nginx-environment-variables-php-fpm/</guid><description>It&apos;s a common thing to use environment variables to configure Symfony for dev, staging, production...</description><pubDate>Sun, 13 Dec 2015 00:00:00 GMT</pubDate><category>development</category><category>infrastructure</category></item><item><title>Unreachable hosts in Docker containers with external links</title><link>https://ypereirareis.github.io/posts/docker-container-external-links-alias-hosts-unavailable/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/docker-container-external-links-alias-hosts-unavailable/</guid><description>Why a shared service like Mailcatcher becomes unreachable from containers using docker-compose (external) links, and how to work around it.</description><pubDate>Tue, 01 Dec 2015 00:00:00 GMT</pubDate><category>platform</category><category>infrastructure</category></item><item><title>DoctrineMongoDBBundle composer install with Docker and HHVM</title><link>https://ypereirareis.github.io/posts/symfony-doctrine-mongodb-bundle-composer-hhvm/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/symfony-doctrine-mongodb-bundle-composer-hhvm/</guid><description>DoctrineMongoDBBundle can be installed with a composer docker container and HHVM, but it can lead to problems or errors</description><pubDate>Fri, 13 Nov 2015 00:00:00 GMT</pubDate><category>development</category><category>platform</category></item><item><title>DoctrineMongoDBBundle: multiple connections and auth</title><link>https://ypereirareis.github.io/posts/symfony-doctrine-mongodb-bundle-multiple-connections-authentication/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/symfony-doctrine-mongodb-bundle-multiple-connections-authentication/</guid><description>Configure several MongoDB connections with authentication in DoctrineMongoDBBundle, and fix the SASL authentication and missing service errors.</description><pubDate>Thu, 12 Nov 2015 00:00:00 GMT</pubDate><category>development</category></item><item><title>Merge Less, Sass and CSS into a single file with Gulp</title><link>https://ypereirareis.github.io/posts/gulp-merge-less-sass-css/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/gulp-merge-less-sass-css/</guid><description>Merging Less, Sass and plain CSS into one stylesheet with Gulp is not obvious. Here is a gulpfile that outputs a single minified CSS file.</description><pubDate>Thu, 22 Oct 2015 00:00:00 GMT</pubDate><category>development</category></item><item><title>How to get environment variables in a gulpfile</title><link>https://ypereirareis.github.io/posts/gulp-gulpfile-environment-variable/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/gulp-gulpfile-environment-variable/</guid><description>Use an environment variable to build conditional functions in a gulpfile. Really useful for multi-environment configurations.</description><pubDate>Tue, 13 Oct 2015 00:00:00 GMT</pubDate><category>development</category></item><item><title>Repair a server with the OVH and Kimsufi rescue mode</title><link>https://ypereirareis.github.io/posts/ovh-rescue-mode/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/ovh-rescue-mode/</guid><description>Locked out of your server after breaking SSH access? Boot it in OVH or Kimsufi rescue mode, mount the disk and fix the configuration.</description><pubDate>Fri, 02 Oct 2015 00:00:00 GMT</pubDate><category>infrastructure</category></item><item><title>Zero downtime Elasticsearch reindex with FOSElasticaBundle</title><link>https://ypereirareis.github.io/posts/elasticsearch-foselasticabundle-symfony-index-aliases-and-zero-downtime/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/elasticsearch-foselasticabundle-symfony-index-aliases-and-zero-downtime/</guid><description>FOSElasticaBundle can reindex Elasticsearch without downtime thanks to index aliases. Here is the Symfony configuration you need.</description><pubDate>Thu, 28 May 2015 00:00:00 GMT</pubDate><category>development</category><category>architecture</category></item><item><title>Docker with shell script or Makefile</title><link>https://ypereirareis.github.io/posts/docker-with-shell-script-or-makefile/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/docker-with-shell-script-or-makefile/</guid><description>Stop typing long docker run commands: wrap them in a shell script, a Makefile or Docker Compose to be more productive in development.</description><pubDate>Mon, 04 May 2015 00:00:00 GMT</pubDate><category>platform</category></item><item><title>Vagrant AWS provider with private repositories</title><link>https://ypereirareis.github.io/posts/vagrant-aws-provider-private-repositories/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/vagrant-aws-provider-private-repositories/</guid><description>Provision AWS instances with Vagrant and the vagrant-aws provider when your provisioning needs to clone private Git repositories over SSH.</description><pubDate>Mon, 02 Mar 2015 00:00:00 GMT</pubDate><category>infrastructure</category></item><item><title>Start an Elasticsearch cluster in seconds with Vagrant</title><link>https://ypereirareis.github.io/posts/vagrant-elasticsearch-cluster/</link><guid isPermaLink="true">https://ypereirareis.github.io/posts/vagrant-elasticsearch-cluster/</guid><description>A Vagrant project to start a multi-node Elasticsearch cluster with a single command, to test sharding, network settings and failures.</description><pubDate>Thu, 26 Feb 2015 00:00:00 GMT</pubDate><category>infrastructure</category></item></channel></rss>