title: Docker compose - save configuration
body: <p>Here's my docker-compose.yml file, adapted from <a href="https://blog.wodby.com/6-reasons-to-deploy-drupal-8-with-docker-how-to-guide-b2f073e61672" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code>version: '3.1'
  
  services:
  
    mysql:
      image: mariadb
      environment:
         MYSQL_DATABASE: drupal8
         MYSQL_USER: drupal8
         MYSQL_PASSWORD: drupal8
         MYSQL_ROOT_PASSWORD: admin
      volumes:
        - /var/lib/mysql
      restart: always
  
    drupal:
      image: drupal:8.2-apache
      ports:
        - 8080:80
      volumes:
        - /var/www/html/modules
        - /var/www/html/profiles
        - /var/www/html/themes
        # this takes advantage of the feature in Docker that a new anonymous
        # volume (which is what we're creating here) will be initialized with the
        # existing content of the image at the same location
        - /var/www/html/sites
      restart: always
      links:
        - mysql
  </code></pre>
  
  <p>Now on running this and opening up <code>localhost:8080</code> in my browser, I'm presented with Drupal's configuration setup, which I duly follow and presto, my first Drupal page is created. What I ultimately need to do is:</p>
  
  <ol>
  <li>Save the configuration somehow, so that the settings persist </li>
  <li>Be able to push these two containers to a single repository in Docker Hub</li>
  </ol>
  
  <p>The end goal is to be able to issue <code>docker run myDockerHubUsername/myRepo</code>, which would pull these two containers and Drupal would be preconfigured.</p>