Home » How to install Drupal latest, MySQL 5.7 on Docker with Docker Compose file

How to install Drupal latest, MySQL 5.7 on Docker with Docker Compose file

by Pring
How to install Drupal latest, MySQL 5.7 on Docker with Docker Compose file

Introduction:

This archive is about how to install Drupal latest and MySQL 5.7 on Docker with Docker Compose file.

I. Install Drupal latest, MySQL 5.7 on Docker with Docker Compose file by step by step.

To install Drupal latest, MySQL 5.7 on Docker with Docker Compose file. Follow these steps:
Step 1. Create docker compose file.
Step 2. Install Drupal and MySQL 5.7.
Step 3. Start Docker Compose.
Step 4. Initialize Drupal.
Step 5. Stop Docker Compose.

You can see details of Video on How to install Drupal latest, MySQL 5.7 on Docker with Docker Compose file as below.
[Sorry, the video we will update later]

Or you also can see details as below.

Step 1. Create docker compose file.

Create “docker-compose.yml” file as below:

version: '3'

service:
  database:
    image: mysql:5.7
    volumes:
      - database_data: /var/lib/mysql
    restart: always
    environment:
     MYSQL_DATABASE: test
     MYSQL_USER: test
     MYSQL_PASSWORD: test
     MYSQL_ROOT_PASSWORD: rootpass
  
  drupal:
    depends_on:
      - database
    image: drupal:latest
    port:
      - "8080:80"
    restart: always

volumes:
  database_data:

Step 2. Install Drupal and MySQL 5.7.

Start the Command Prompt(CMD) or PowerShell and move to the Working folder.
Then, execute the following command.

$ docker pull drupal:latest
$ docker-compose build

Step 3. Start Docker Compose.

To start Drupal, execute the following command.

docker-compose up -d

Step 4. Initialize Drupal.

On Browser, enter the URL “http://localhost:8080/”

Step 5. Stop Docker Compose.

To stop Drupal, execute the following command.

$ docker-compose down

II. Conclusion.

In this tutorial, we’ve installed install Drupal latest, MySQL 5.7 on Docker with Docker Compose. If you hit a problem or have feedback, leave a comment below.


Install Drupal latest, MySQL 5.7 on Docker with Docker Compose is complete. Wish you success and luck.
Thanks and best regards!
— Pring —

Related Articles

Leave a Comment