Skip to content

Instantly share code, notes, and snippets.

@geerlingguy
Created December 14, 2018 22:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geerlingguy/5998fe7cd13520498df0578b9ba366ea to your computer and use it in GitHub Desktop.
Save geerlingguy/5998fe7cd13520498df0578b9ba366ea to your computer and use it in GitHub Desktop.
BLT Docker Image Dockerfile
# Note: Your base image should contain all the PHP extensions required by your project.
FROM my/base-drupal-container:latest
# Set the project machine name here.
ENV PROJECT my-blt-project
# Copy the deployment artifact into place.
COPY deploy/ /var/www/$PROJECT
# Copy the Drupal container settings file into place.
COPY docker/settings.container.php /var/www/$PROJECT/docroot/sites/default/settings.container.php
# Set a custom docroot since BLT uses 'docroot'.
ENV APACHE_DOCUMENT_ROOT /var/www/$PROJECT/docroot
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Set appropriate permissions on sites/default directory.
RUN chmod 665 /var/www/$PROJECT/docroot/sites/default
# Set appropriate permissions on public files directory.
RUN mkdir -p /var/www/$PROJECT/docroot/sites/default/files \
&& chown www-data:www-data /var/www/$PROJECT/docroot/sites/default/files
WORKDIR /var/www/$PROJECT
@geerlingguy
Copy link
Author

You'd probably be better moving off to one of those other solutions; Drupal VM's docker functionality is not aligned with the way most of the blt integration is set up to work (note that BLT and Drupal VM are separate but related projects).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment