Answer the question
In order to leave comments, you need to log in
What needs to be written in volumes to store the Drupal database not only in the container but also on the computer?
I have Ubuntu 18.04 OS. I downloaded Drupal9 to my desktop using: composer create-project drupal/recommended-project project_name. I will raise the Drupal project using the Docker-based Drupal stack , and after running the images and writing in the url: projectname.localhost:8000 , the Drupal installation window will start.
But before that, I need to uncomment volumes in the docker-compose.yml file in the part of the code that belongs to mariadb and write something to store the Drupal database not only in the container but also on the computer. I don't know exactly what to write.
services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
# volumes:
# - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
# - /path/to/mariadb/data/on/host:/var/lib/mysql # Use bind mount
# Place init .sql file(s) here.
# - /path/to/mariadb/data/on/host:/var/lib/mysql # Use bind mount
Answer the question
In order to leave comments, you need to log in
Usually something like this is enough to write:
...
volumes:
- ./db:/var/lib/mysql
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question