Skip to content

Instantly share code, notes, and snippets.

@manishmore
Created November 10, 2018 14:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manishmore/b27fbf53cbe746c8de2e7f34d519032a to your computer and use it in GitHub Desktop.
Save manishmore/b27fbf53cbe746c8de2e7f34d519032a to your computer and use it in GitHub Desktop.
Install Drupal through the Docker Composer.
Here is the docker command to launch a MySQL 5.7 container, name it "DrupalMysql", set a
few environment variables, expose the MySQL port 3306 as 3308 on the local host and daemonise it:
docker run \
--name DrupalMysql \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
-e MYSQL_DATABASE=drupal \
-e MYSQL_USER=drupal \
-e MYSQL_PASSWORD=drupal \
-p 3308:3306 \
-d \
mysql:5.7
Here is the docker command to launch Drupal 8 in a "Drupal8" container, link it to the previous container's MySQL port,
expose it's web port 80 as 8010 on the local host and daemonise it:
docker run \
--name Drupal8 \
--link DrupalMysql:mysql \
-p 8010:80 \
-d \
drupal:8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment