Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default settings file does not exist - during installation (docker setup)

Tags:

docker

drupal

I'm trying to setup Drupal site locally with docker. Using docker image 9.1.6-apache-buster from:

https://hub.docker.com/_/drupal

Running it on MacOs Mojave on Docker Desktop

My docker-compose.yml file looks like this:

version: "3.9"

services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: mysqlRoot
      MYSQL_DATABASE: drupal_db
      MYSQL_USER: drupal
      MYSQL_PASSWORD: drupal

  drupal:
    depends_on:
      - db
    image: drupal:9.1.6-apache-buster
    ports:
      - "8000:80"
    restart: always
    environment:
      MYSQL_DATABASE: drupal_db
      MYSQL_USER: drupal
      MYSQL_PASSWORD: drupal
      MYSQL_ROOT_PASSWORD: mysqlRoot

    volumes:
      - ./modules:/var/www/html/modules
      - ./sites:/var/www/html/sites
      - ./themes:/var/www/html/themes
volumes:
  db_data: {}

Installation goes well until I reach "requirements" installation step. Then I get errors:

The default settings file does not exist.
The Drupal installer requires that the ./sites/default/default.settings.php file must not be deleted or modified from the original download.

and

The Drupal installer requires that you create a ./sites/default/settings.php as part of the installation process. Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php. More details about installing Drupal are available in INSTALL.txt.

https://snipboard.io/HAmU1o.jpg

Directories are created and I can see them on mac side, but they are empty?! Not a single file there:

modules
sites
  default
   files
themes

I guess it's some permissions problem?

like image 304
MilanG Avatar asked Dec 13 '25 12:12

MilanG


1 Answers

I found the default.settings.php file in a subdirectory under /opt/drupal. From there I had to copy it to the expected location in var/www/html/sites/default, change the owner to www-data, and copy it to settings.php as well:

cp /opt/drupal/web/core/assets/scaffold/files/default.settings.php /var/www/html/sites/default/
chown www-data:www-data /var/www/html/sites/default/default.settings.php
cp /var/www/html/sites/default/default.settings.php /var/www/html/sites/settings.php
like image 182
jormaster3k Avatar answered Dec 15 '25 06:12

jormaster3k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!