Skip to content

Commit

Permalink
adding entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-bdonohue committed Aug 8, 2024
1 parent 40ea02d commit 1f1b74c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ RUN sed -i 's/memory_limit = .*/memory_limit = 1024M/' /usr/local/etc/php/php.in
COPY config/ /var/www/config/
COPY load.environment.php /var/www/load.environment.php
COPY mat.settings.php /var/www/html/sites/default/settings.php
COPY entrypoint.sh /var/www/entrypoint.sh

# Make sure config/sync is writable.
RUN chmod -R g+w,g+r /var/www/config
Expand All @@ -123,3 +124,7 @@ ENV COMPOSER_PROCESS_TIMEOUT=2000

# So that drush works from outside the container.
WORKDIR /var/www

# Entrypoint
RUN ["chmod", "+x", "/var/www/entrypoint.sh"]
ENTRYPOINT [ "entrypoint.sh" ]
20 changes: 20 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -ev

repo_root="/var/www/html/"
cd $repo_root

echo 'Clearing drush cache.'
drush cr -y -v

echo 'Updating drupal database.'
drush updb -y -v

echo 'Importing config.'
drush config-import --no-interaction -v

echo 'Clearing drush cache again.'
drush cr -y -v

docker-php-entrypoint

0 comments on commit 1f1b74c

Please sign in to comment.