Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1328] Added support for custom configuration location via DRUPAL_CONFIG_PATH. #1330

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .docker/cli.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ ENV DRUPAL_PRIVATE_FILES=${DRUPAL_PRIVATE_FILES}
ARG DRUPAL_TEMPORARY_FILES="${TMP:-/tmp}"
ENV DRUPAL_TEMPORARY_FILES=${DRUPAL_TEMPORARY_FILES}

ARG DRUPAL_CONFIG_PATH="/app/config/default"
ENV DRUPAL_CONFIG_PATH=${DRUPAL_CONFIG_PATH}

# Set default values for environment variables.
# These values will be overridden if set in docker-compose.yml or .env file
# during build stage.
Expand Down Expand Up @@ -95,8 +98,8 @@ RUN npm --prefix /app/${WEBROOT}/themes/custom/your_site_theme ci --no-audit --n
COPY . /app

# Create files directories and set correct permissions.
RUN mkdir -p "${DRUPAL_PUBLIC_FILES}" "${DRUPAL_PRIVATE_FILES}" "${DRUPAL_TEMPORARY_FILES}" && \
chmod 0770 "${DRUPAL_PUBLIC_FILES}" "${DRUPAL_PRIVATE_FILES}" "${DRUPAL_TEMPORARY_FILES}"
RUN mkdir -p "${DRUPAL_PUBLIC_FILES}" "${DRUPAL_PRIVATE_FILES}" "${DRUPAL_TEMPORARY_FILES}" "${DRUPAL_CONFIG_PATH}" && \
chmod 0770 "${DRUPAL_PUBLIC_FILES}" "${DRUPAL_PRIVATE_FILES}" "${DRUPAL_TEMPORARY_FILES}" "${DRUPAL_CONFIG_PATH}"

# Compile front-end assets. Running this after copying all files as we need
# sources to compile assets.
Expand Down
8 changes: 8 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -70,6 +71,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -118,6 +120,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -173,6 +176,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -209,6 +213,7 @@
"build": {
"args": {
"CLI_IMAGE": "star_wars",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_TEMPORARY_FILES": "/tmp",
Expand All @@ -228,6 +233,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -290,6 +296,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -362,6 +369,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down
8 changes: 8 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.env_local.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -70,6 +71,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -118,6 +120,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -173,6 +176,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -209,6 +213,7 @@
"build": {
"args": {
"CLI_IMAGE": "star_wars",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_TEMPORARY_FILES": "/tmp",
Expand All @@ -228,6 +233,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -290,6 +296,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down Expand Up @@ -362,6 +369,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "0",
Expand Down
8 changes: 8 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.env_mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "1",
Expand Down Expand Up @@ -70,6 +71,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "1",
Expand Down Expand Up @@ -118,6 +120,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "1",
Expand Down Expand Up @@ -173,6 +176,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "1",
Expand Down Expand Up @@ -209,6 +213,7 @@
"build": {
"args": {
"CLI_IMAGE": "the_matrix",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_TEMPORARY_FILES": "/tmp",
Expand All @@ -228,6 +233,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "1",
Expand Down Expand Up @@ -290,6 +296,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "1",
Expand Down Expand Up @@ -362,6 +369,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "the_matrix.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "1",
Expand Down
8 changes: 8 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.noenv.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "",
Expand Down Expand Up @@ -70,6 +71,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "",
Expand Down Expand Up @@ -118,6 +120,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "",
Expand Down Expand Up @@ -173,6 +176,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "",
Expand Down Expand Up @@ -209,6 +213,7 @@
"build": {
"args": {
"CLI_IMAGE": "star_wars",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_TEMPORARY_FILES": "/tmp",
Expand All @@ -228,6 +233,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "",
Expand Down Expand Up @@ -290,6 +296,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "",
Expand Down Expand Up @@ -362,6 +369,7 @@
"environment": {
"CI": "true",
"DREVOPS_LOCALDEV_URL": "star_wars.docker.amazee.io",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
"DRUPAL_REDIS_ENABLED": "",
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ x-environment: &default-environment
CI: ${CI:-}
# Forward emails to Mailhog locally.
SSMTP_MAILHUB: ${SSMTP_MAILHUB:-host.docker.internal:1025}
# Path to configuration files.
DRUPAL_CONFIG_PATH: ${DRUPAL_CONFIG_PATH:-/app/config/default}
# Drupal file paths.
DRUPAL_PUBLIC_FILES: ${DRUPAL_PUBLIC_FILES:-/app/web/sites/default/files}
DRUPAL_PRIVATE_FILES: ${DRUPAL_PRIVATE_FILES:-/app/web/sites/default/files/private}
Expand Down Expand Up @@ -114,6 +116,7 @@ services:
args:
CLI_IMAGE: *cli-image
WEBROOT: "${DREVOPS_WEBROOT:-web}"
DRUPAL_CONFIG_PATH: ${DRUPAL_CONFIG_PATH:-/app/config/default}
DRUPAL_PUBLIC_FILES: ${DRUPAL_PUBLIC_FILES:-/app/web/sites/default/files}
DRUPAL_PRIVATE_FILES: ${DRUPAL_PRIVATE_FILES:-/app/web/sites/default/files/private}
DRUPAL_TEMPORARY_FILES: ${DRUPAL_TEMPORARY_FILES:-/tmp}
Expand Down
Loading