Hello,

I am having trouble understanding how variable substitution works in the drupal.conf file.

When I build my Docker image from the Dockerfile, the drupal.conf file is correctly present inside the container, but it still contains the variables, for example:

DocumentRoot /var/www/html/${DOCROOT_FOLDER}

The values are not being substituted with the environment variables.

Inside the container, if I run:

echo ${DOCROOT_FOLDER}

I correctly get:

web

However, when I make a request to the Apache server, it attempts to serve index.php from:

/var/www/html

instead of:

/var/www/html/web

It seems as if Apache is not taking the environment variable into account.

Do you have any idea what I might be missing?

Thank you.

Comments

cedrxc created an issue. See original summary.

cedrxc’s picture

Hi,

I’ve figured out the cause of the issue.

It’s not related to variable substitution. The reason is that there is another file in the sites-enabled folder called 000-default.conf. My request was being handled by this file instead of drupal.conf when I left localhost as the APP_DOMAIN.

When I changed APP_DOMAIN to a name like drupal.local and updated my /etc/hosts with:

127.0.0.1 drupal.local

I was able to reach the correct configuration via drupal.local.

So as I understand it, it’s not possible to use localhost as APP_DOMAIN. This makes sense, but for testing the module I hadn’t bothered to create a local DNS entry.

cedrxc’s picture

Status: Active » Needs review
jonhattan’s picture

Version: 1.1.0 » 1.1.x-dev
Category: Support request » Bug report
Status: Needs review » Needs work

you're right, we want to `RUN rm a2dissite 000-default` for APP_DOMAIN=localhost to work.

jonhattan’s picture

Status: Needs work » Fixed

Fixed.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.