OpenResty (nginx) with auto generated SSL certificate from Let’s Encrypt

I started with a startssl.com free SSL certificate to use encrypted connections for my website. This works fine, but I have to update the SSL certificate every year manually. Let’s Encrypt offers auto (re)generate SSL certificates and there exists different implementations. The only option for me was Docker of course, but not with an extra Docker container. nginx has support for Lua, » ...

Docker Daemon tuning and JSON file configuration

The default Docker config works but there are some additional features which improves the overall experience with Docker. We will create a JSON config file with optimized options for the Docker Daemon, install bash completion for the Docker CLI commands with one line and increase security. But first things first. Docker / Docker Compose installation Please refer to the official Docker installation docs to install Docker » ...

My talk Docker for PHP Developers at PHP.RUHR

I'm very excited to give a talk at the PHP.RUHR conference in Dortmund. This conference takes place on November 10th for the third time in the Ruhr area, which is the largest metropolitan region in Germany. In addition to the programming language PHP, related topics such as IT security, databases and web hosting are also highlighted at the event. There are fifteen talks in » ...

My conference talks in September

I'm thrilled to give two talks in September on different conferences. This is my first time, to be a Speaker on such a stage. I am very happy to have been accepted. Hopefully you can join and enjoy my talks. The first talk on 24th September in Dresden is about PHP Docker builds and the second one on 30th September in Hamburg is about PHP » ...

Docker Compose with named Volumes and multiple Networks

In Docker Compose 1.6 or higher Networks and Volumes are now first class citizens. This means you have more control and you can use individual services in one or more networks. Sharing volumes have been improved. It was never so easy. A new docker-compose.yml format was introduced. The Docker compose config file must start with an entry version: "2" to use the new » ...

Docker for PHP Developers

Docker is a great way to emulate live server environment. Sure, you don't have the same hardware, but you can have the same infrastructure stack like multiple web, PHP-FPM, Database, CDN server and so on. Another reason why to use Docker for PHP development is, that it's faster than Vagrant and needs much fewer resources as Virtual Box machines. But it's also possible to use » ...

Docker with OverlayFS on Ubuntu

Docker uses the DeviceMapper storage driver as default if no other driver is available. That's ok and it works, mostly. I run, sometimes into trouble, because the container could not be started. At the end, I have to delete Docker container and images and create it again. The OverlayFS driver is faster than DeviceMapper and aufs. You can also read more about OverlayFS on Docker. » ...

Generate awesome docs from Markdown files with Docker and bookdown.io

More and more projects uses bookdown.io to generate their documentation from Markdown files. This has several benefits. You can easily generate an awesome stylish documentation with syntax highlighting by using another template. It's even possible to create an own book based on the bookdown.io book or on every other Markdown file. It's not necessary to download the repository to generate the documentation. If » ...

Using Composer cache in a Docker container

If you use the Composer Docker container you have the problem, that there is no Composer package cache, because the state of the Docker container is not saved. That's no problem, if you have only one project. If you have multiple projects it's a waste of time to download every package again and again. There is a simple trick to solve this problem. Start Composer » ...

Docker PHP Xdebug CLI debugging

I use Docker for development and for my website too. Now it's time to throw away var_dump and to use Xdebug for PHP Docker container. It's quite easy, because I have created a Docker PHP Xdebug Image on Docker Hub. You have only to set your path mappings in your IDE. This image can also be used to generate the code coverage with PHPUnit. » ...

Logrotate for Docker container

It's a best practice to log the Docker container output to /dev/stdout and /dev/stderr. But you should not forget to enable a Logrotate for your Docker container log files. The Docker container log file is saved in /var/lib/docker/containers/[CONTAINER ID]/[CONTAINER_ID]-json.log. You can use another service like fluentd or the ELK (Elasticsearch, Logstash, Kibana) stack but this » ...

Configuring nginx to speed up Ghost blog powered by Docker

I was searching for some nginx configurations and found a blog post to speed up a Ghost blog. Unfortunately it doesn't work out of the box. However it was very interesting to set up nginx as a reverse proxy and cache for my Node.js Ghost blog powered by Docker. nginx configuration The nginx configuration is more complex. I want to serve static content directly » ...