Skip to content

Setting up a Drupal 8 site

Kristian Kaa edited this page Jun 23, 2017 · 1 revision

Setting up a new D8 site

Deploying a site with Deployer will setup shared files and folder automatically.
The deployment path, in the deployer script (dep.php), should be set at /usr/share/nginx/html/mynewsite.

On first deployment, deployer will setup a directory structure like:

  • mynewsite
    |- releases
    |- current (symlink to latest release)
    |- shared
    |- |- sites
    |- |- |- default
    |- |- |- |- settings.php
    |- |- |- |- services.yml
    |- |- |- |- files

In the following sections, each file and folder in the shared folder will be addressed.

settings.php

An empty settings file is setup.
Copy the default.settings.php from the sites/default folder and make it writeable by Drupal.

services.yml

Same as the settings.php, only it won't have to be writeable.

files

The files folder in the shared folder, will most likely not be used. If set up properly, the Docker configuration for the site, should use a data volume for the files folder, like: - mynewsite_files:/var/www/html/sites/default/files

Copying existing files into the data volume

If the site being set up, is not a new site, a file directory should probably be copied into the data volume.
To do this, copy the tarball of the files folder, into the running Docker container. docker cp files.tar.gz mynewsite.site:/var/www/html/sites/default/files

Now enter the container, and extract the tarball in the files directory.

docker exec -ti mynewsite.site bash
cd /var/www/html/sites/default/files
tar -zxvf files.tar.gz
rm files.tar.gz
cd ..
chmod -R 777 files