<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <generator uri="https://astro.build/">Astro</generator>
  <link href="https://ahumaro.com/feed.xml" rel="self" type="application/atom+xml" />
  <link href="https://ahumaro.com/" rel="alternate" type="text/html" />
  <updated>2020-07-09T10:00:00.000Z</updated>
  <id>https://ahumaro.com/feed.xml</id>
  <title type="html">Ahumaro Mendoza</title>
  <subtitle>Enterprise &amp; Solutions Architecture | Cloud, Distributed Systems &amp; Tech Leadership</subtitle>
  
    <entry>
      <title type="html">Grav-PHP-Nginx with Docker</title>
      <link href="https://ahumaro.com/011-docker/" rel="alternate" type="text/html" title="Grav-PHP-Nginx with Docker" />
      <published>2020-07-09T10:00:00.000Z</published>
      <updated>2020-07-09T10:00:00.000Z</updated>
      <id>https://ahumaro.com/011-docker/</id>
      <content type="html" xml:base="https://ahumaro.com/011-docker/">&lt;p&gt;When we talk about Content Management Systems, major names comes to our minds like Drupal, Joomla or WordPress, but if we want a modern, simple but also very powerful CMS, Grav is the new comer to this game.&lt;/p&gt;
&lt;p&gt;Now, If we pair Grav CMS with Docker and Nginx, we have a very light and efficient team for the win in a small footprint.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can find my &lt;strong&gt;Dockerfile&lt;/strong&gt; ready to build on my &lt;a href=&quot;https://github.com/ahumaro/Grav-PHP-Nginx&quot;&gt;&lt;strong&gt;Github&lt;/strong&gt;&lt;/a&gt; account.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;You can get a &lt;strong&gt;Docker image&lt;/strong&gt; ready to run in my &lt;a href=&quot;https://registry.hub.docker.com/u/ahumaro/grav-php-nginx/&quot;&gt;&lt;strong&gt;DockerHub&lt;/strong&gt;&lt;/a&gt; account (&lt;strong&gt;ahumaro/grav-php-nginx&lt;/strong&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;one-process-per-container-or-not&quot;&gt;One process per container or not&lt;/h4&gt;
&lt;p&gt;In theory, the use of Docker and containers encourage the &lt;strong&gt;&lt;em&gt;one process per container&lt;/em&gt;&lt;/strong&gt; philosophy but, from the point of view of software as a service, maybe we can focus this article with the philosophy of &lt;strong&gt;&lt;em&gt;one service per container&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h4 id=&quot;dockerfile-step-by-step&quot;&gt;Dockerfile step-by-step&lt;/h4&gt;
&lt;p&gt;Lets try it. Lets create a new Docker container and inside it, lets build our CMS stack with Nginx, PHP and Grav in a few easy steps. All of this builded automatically by docker and guided by a Dokerfile.&lt;/p&gt;
&lt;h5 id=&quot;step-0-phusion-as-a-base-container&quot;&gt;Step 0: Phusion as a base container&lt;/h5&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;FROM phusion/baseimage:0.9.16&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this Dockerfile instruction, Phusion will be the base image for this container. Version 0.9.16 is based on &lt;strong&gt;Ubuntu 14.04 LTS&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Usually, a docker container is based in a Linux distro, it depends on your needs but, sometimes, the distro is too fat, not very friendly nor efficient living in a container. That’s why solutions like Phusion comes in handy due to its extra utilities and its lightweight footprint. For more information: &lt;a href=&quot;https://github.com/phusion/baseimage-docker&quot;&gt;&lt;strong&gt;Phusion Github&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h5 id=&quot;step-1-install-core-packages&quot;&gt;Step 1: Install core packages&lt;/h5&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Install core packages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN apt-get update -q&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN apt-get upgrade -y -q&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN apt-get install -y -q php5 php5-cli php5-fpm php5-gd php5-curl php5-apcu ca-certificates nginx git-core&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN apt-get clean -q &amp;amp;&amp;amp; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Instructions to install the core packages for the container like nginx, php and git&lt;/p&gt;
&lt;h5 id=&quot;step-2-get-latest-grav-from-git-and-install-it&quot;&gt;Step 2: Get latest Grav from Git and install it&lt;/h5&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Get Grav&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN rm -fR /usr/share/nginx/html/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN git clone https://github.com/getgrav/grav.git /usr/share/nginx/html/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Install Grav&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;WORKDIR /usr/share/nginx/html/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN bin/composer.phar self-update&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN bin/grav install&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN chown www-data:www-data .&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN chown -R www-data:www-data *&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN find . -type f | xargs chmod 664&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN find . -type d | xargs chmod 775&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN find . -type d | xargs chmod +s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN umask 0002&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Instructions to checkout Grav from Github and then run installation scripts. Also assign permissions for the Grav folders.&lt;/p&gt;
&lt;h5 id=&quot;step-3-setup-grav-inside-nginx&quot;&gt;Step 3: Setup Grav inside Nginx&lt;/h5&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Configure Nginx - enable gzip&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN sed -i &apos;s|# gzip_types|  gzip_types|&apos; /etc/nginx/nginx.conf&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Setup Grav configuration for Nginx&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN touch /etc/nginx/grav_conf.sh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN chmod +x /etc/nginx/grav_conf.sh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN echo &apos;#!/bin/bash \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    echo &quot;&quot; &amp;gt; /etc/nginx/sites-available/default \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    ok=&quot;0&quot; \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    while IFS=&quot;&quot; read line \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    do \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        if [ &quot;$line&quot; = &quot;    server {&quot; ]; then \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            ok=&quot;1&quot; \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        fi \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        if [ &quot;$line&quot; = &quot;}&quot; ]; then \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            ok=&quot;0&quot; \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        fi \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        if [ &quot;$ok&quot; = &quot;1&quot; ]; then \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;            echo &quot;$line&quot; &amp;gt;&amp;gt; /etc/nginx/sites-available/default \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        fi \n\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    done &amp;lt; /usr/share/nginx/html/nginx.conf&apos; &amp;gt;&amp;gt; /etc/nginx/grav_conf.sh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN /etc/nginx/grav_conf.sh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN sed -i \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        -e &apos;s|root   html|root   /usr/share/nginx/html|&apos; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;        -e &apos;s|127.0.0.1:9000;|unix:/var/run/php5-fpm.sock;|&apos; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    /etc/nginx/sites-available/default&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The previous instructions look a little trickier but in fact they do a very easy task: put the Grav configuration instructions inside Nginx.&lt;/p&gt;
&lt;p&gt;Grav comes with a Nginx configuration file in the root of the installation and the previous script reads this configuration and writes it inside Nginx available sites.&lt;/p&gt;
&lt;h5 id=&quot;step-4-setup-daemons-to-run-at-container-startup&quot;&gt;Step 4: Setup daemons to run at container startup&lt;/h5&gt;
&lt;p&gt;Because we are using Phusion as the base image for the container, this image comes with a special init system (&lt;code&gt;/sbin/my_init&lt;/code&gt;) that solves the PID 1 zombie reaping problem and also allows us to configure services to start automatically with ease.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Configure Nginx daemon&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN mkdir /etc/service/nginx&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ADD build/daemons/nginx.sh /etc/service/nginx/run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN chmod +x /etc/service/nginx/run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Configure PHP-FPM daemon&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN mkdir /etc/service/php-fpm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ADD build/daemons/php-fpm.sh /etc/service/php-fpm/run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN chmod +x /etc/service/php-fpm/run&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;step-5-configure-ssh-service&quot;&gt;Step 5: Configure SSH service&lt;/h5&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Enable SSH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN rm -f /etc/service/sshd/down&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUN /etc/my_init.d/00_regen_ssh_host_keys.sh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;step-6-expose-ports-and-volumes&quot;&gt;Step 6: Expose ports and volumes&lt;/h5&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Expose ports&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;EXPOSE 80 22&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;#Expose volumes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;VOLUME [&quot;/usr/share/nginx/html&quot;, &quot;/etc/nginx&quot;, &quot;/root/.ssh&quot;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;build-the-docker-image&quot;&gt;Build the Docker image&lt;/h4&gt;
&lt;p&gt;Now we are ready to build the image:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;docker build -t=&quot;ahumaro/grav-php-nginx:0.0.1&quot; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;run-the-container&quot;&gt;Run the container&lt;/h4&gt;
&lt;p&gt;Run the container using:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;root [ ~ ]# docker run -d -p 8080:80 -p 2222:22 ahumaro/grav-php-nginx:0.0.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here you can see how you can redirect the ports. For example, port 22 of the container will be redirected to port 2222 in the host. To access your container make a ssh connection to port 2222 on your host.&lt;/p&gt;
&lt;h4 id=&quot;test-the-final-product&quot;&gt;Test the final product&lt;/h4&gt;
&lt;p&gt;The new container is up and running. Nginx and Grav is ready to handle new requests so lets try it. Open a browser and point it to the host machine with port 8080, this will redirect the request to port 80 on the container where Nginx-Grav is waiting. You will get the following result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/011/docker01.png&quot; alt=&quot;Grav-Nginx with Docker&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;next-steps-and-recommendations&quot;&gt;Next steps and recommendations&lt;/h4&gt;
&lt;p&gt;Now you are ready to run but don’t forget there are many more possibilities that you can explore. For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;How to find the exposed volumes on the host is very easy, first find the ID of the running container with the following command:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;root [ ~ ]# docker ps&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;CONTAINER ID        IMAGE                           COMMAND             CREATED             STATUS              PORTS                                        NAMES&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;560abd21e5a4        ahumaro/grav-php-nginx:latest   &quot;/sbin/my_init&quot;     16 minutes ago      Up 16 minutes       0.0.0.0:2223-&amp;gt;22/tcp, 0.0.0.0:8080-&amp;gt;80/tcp   nostalgic_babbage&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With the ID, inspect the container and look for the section &lt;strong&gt;Volumes&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;root [ ~ ]# docker inspect 560abd21e5a4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;Volumes&quot;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;/etc/nginx&quot;: &quot;/var/lib/docker/vfs/dir/7e618a0800605659352f5f69ab2c58eee555a7f725a3ef46f016e2d269d1e11e&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;/root/.ssh&quot;: &quot;/var/lib/docker/vfs/dir/24db3321bd511e2134dd3f6487707e62accd2bcbf2cfd299773aba9c7cb79a18&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;      &quot;/usr/share/nginx/html&quot;: &quot;/var/lib/docker/vfs/dir/5c927c2485052a57e70ea66bda9911479e581eceb891f5ea12a38f061a209591&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you can see the mappings and you can access those folders from the host, for example, you can insert your public key inside SSH user config folder of the container.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;cat my_ssh_key.pub &amp;gt; /var/lib/docker/vfs/dir/24db3321bd511e2134dd3f6487707e62accd2bcbf2cfd299773aba9c7cb79a18/authorized_keys&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And test a connection to the container:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ssh -i my_ssh_key -p 2222 root@ip-to-your-host&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For the management of the Grav CMS content, there are many strategies. You can access the root folder from the volumes exposed, or access directly to the container via SSH. The way I recommend is to synchronize the user folder of Grav (&lt;code&gt;/usr/share/nginx/html/user&lt;/code&gt;) to a Git repository and just pull new changes inside it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don’t forget you can run your containers on the cloud with services like Google Cloud Run, Google Compute Engine, AWS or Digital Ocean.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remember that you can find &lt;a href=&quot;https://github.com/ahumaro/Grav-PHP-Nginx&quot;&gt;my Grav-PHP-Nginx Dockerfile on GitHub&lt;/a&gt; ready to build or, if you are in a hurry, just get &lt;a href=&quot;https://registry.hub.docker.com/u/ahumaro/grav-php-nginx/&quot;&gt;my pre-built Docker image ready to run at Docker Hub&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;keep-exploring-and-enjoy&quot;&gt;Keep exploring and enjoy!&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Ahumaro Mendoza&lt;/strong&gt;&lt;br/&gt;
&lt;a href=&quot;mailto:ahumaro@ahumaro.com&quot;&gt;ahumaro@ahumaro.com&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.ahumaro.com&quot;&gt;www.ahumaro.com&lt;/a&gt;&lt;/p&gt;
</content>
      <author><name>Ahumaro Mendoza</name><uri>https://ahumaro.com/</uri></author>
      <category term="Articles" />
      <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ahumaro.com/assets/images/011/unsplash_docker.png" />
    </entry>
    <entry>
      <title type="html">Hi!, I&apos;m Ahumaro — Tinkering, Code &amp; Passions</title>
      <link href="https://ahumaro.com/001-ahumaro/" rel="alternate" type="text/html" title="Hi!, I&apos;m Ahumaro — Tinkering, Code &amp; Passions" />
      <published>2020-07-07T10:00:00.000Z</published>
      <updated>2020-07-07T10:00:00.000Z</updated>
      <id>https://ahumaro.com/001-ahumaro/</id>
      <content type="html" xml:base="https://ahumaro.com/001-ahumaro/">&lt;p&gt;Welcome to my personal technology log and tinkering notebook!&lt;/p&gt;
&lt;p&gt;This series of articles is fundamentally an open invitation to &lt;strong&gt;explore, test, and tinker&lt;/strong&gt; with new technologies, prototypes, and engineering solutions. The continuous search for new knowledge and the joy of learning while building test-case scenarios is one of my greatest passions.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-tinkering-spirit-in-and-out-of-the-terminal&quot;&gt;The Tinkering Spirit: In and Out of the Terminal&lt;/h3&gt;
&lt;p&gt;For me, curiosity and hands-on craftsmanship are not confined to software engineering. The same mindset of understanding underlying mechanisms, respecting natural processes, and iterating on recipes translates into everything I enjoy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;In the Kitchen &amp;amp; Bakery:&lt;/strong&gt; I consider myself an amateur chef and an avid baker of natural sourdough breads (&lt;em&gt;masa madre&lt;/em&gt;). There is something deeply grounding—and surprisingly architectural—about culturing wild yeasts, balancing hydration, and baking an artisan loaf with patience and respect for time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fermentation Alchemy:&lt;/strong&gt; Exploring fermented beverages (tepache, mead, and craft ferments) has become a fascinating parallel endeavor where microbiology meets culinary creativity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cinema &amp;amp; Visual Storytelling:&lt;/strong&gt; A hardcore cinephile who truly cherishes the theatrical experience, thoughtful cinematography, and the rich storytelling of Studio Ghibli.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Music:&lt;/strong&gt; Jazz is my sanctuary—especially its exploratory and modern derivatives—though my playlists welcome almost any genre with groove, soul, and complexity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Photography &amp;amp; Exploration:&lt;/strong&gt; Armed with my DSLR, I love taking off on photo safari trips to capture nature, landscapes, and unexpected details in the world around us.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gaming &amp;amp; Culture:&lt;/strong&gt; A long-time part-time gamer with deep appreciation for classics like &lt;em&gt;The Legend of Zelda&lt;/em&gt; and &lt;em&gt;Metal Gear&lt;/em&gt;. I also hold profound admiration for Japanese culture, art, and traditions.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-youll-find-here&quot;&gt;What You’ll Find Here&lt;/h3&gt;
&lt;p&gt;In this space, you will find practical walkthroughs, cloud and container experiments, developer tooling insights, and unfiltered engineering thoughts as I build and test new ideas.&lt;/p&gt;
&lt;img src=&quot;/assets/images/001/001-exploring.jpg&quot; alt=&quot;Photo Safari Exploring&quot; /&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“The joy of tinkering is in the journey of building, failing, understanding, and discovering.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I hope you enjoy exploring these ideas with me. Feel free to connect, exchange thoughts, or talk tech anytime!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(Looking for my formal background, enterprise architecture governance, and professional profile? Visit my &lt;a href=&quot;/about/&quot;&gt;&lt;strong&gt;About&lt;/strong&gt;&lt;/a&gt; page).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keep exploring and enjoy!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ahumaro Mendoza&lt;/strong&gt;&lt;br/&gt;
&lt;a href=&quot;mailto:ahumaro@ahumaro.com&quot;&gt;ahumaro@ahumaro.com&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.ahumaro.com&quot;&gt;www.ahumaro.com&lt;/a&gt;&lt;/p&gt;
</content>
      <author><name>Ahumaro Mendoza</name><uri>https://ahumaro.com/</uri></author>
      <category term="Articles" /><category term="Bio" />
      <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ahumaro.com/assets/images/001/001-ahumaro.jpg" />
    </entry>
</feed>