This explanation is intended for those Drupal installation based in custom source code. For this, its going to be required a database dump and a source code directory (generated with the drush archive-dump command).
The 'drush archive-dump' does a backup your code, files, and database into a single file, a compressed .tgz file. This .tgz file mainly contains (1) a directory with the Drupal instance source code (containing the content from the "/var/www/html/web/" directory in server), (2) a SQL file with a database dump.
Let's call the dumpfile as $DRUPAL_DMP.
In order to use your data with this docker project, you must do the followings steps:
- Make a git clone of the project in $D4D_DIR.
- Copy your web/ codebase in "data/" project directory.
cp $DRUPAL_DMP/web $D4D_DIR/data
- Copy your SQL dump file in "mariadb-init" directory.
cp $DRUPAL_DMP/$DB_DUMP.sql $D4D_DIR/mariadb-init
- Modify the variables in the $D4D_DIR/.env file.
- The values of DB_NAME, DB_USER, and DB_PASSWORD variables must be the same as in specified in the $D4D_DIR/data/web/sites/default/settings.php.
- Optionally, you may modify the PROJECT_NAME and PROJECT_BASE_URL variables.
- Now you can create the Drupal containers (using the make target defined at docker.mk file).
make up
- Now you should be able to access to your Drupal application at http://drupal.docker.localhost:8000 location (or the port setted at TRAEFIK_PORT variable in the .env file) .
- If you cannot, you must configure a new host mapping at your /etc/hosts system file (in order with Drupal documentation at https://wodby.com/docs/stacks/drupal/local/#domains).
127.0.0.1 drupal.docker.localhost
- This docker project is shipped with more services. In example, there is a Portainer service accesible at http://portainer.docker.localhost:8000. You must modify the /etc/hosts file in order to use it too.
If you want to make this services reachables from another network, you can specify the name of this network on the DOCKER_EXTERNAL_NETWORK_NAME environment variable (specified in the .env file). Then you must uncomment the following lines in the docker-compose.yml file:
### Configure this option if you want to add this services to an external network...
networks:
default:
external:
name: ${DOCKER_EXTERNAL_NETWORK_NAME}