Skip to content

Instantly share code, notes, and snippets.

@mheadd
Created March 9, 2021 15:02
Show Gist options
  • Save mheadd/66e0402ee24b6c9ff08eb3d78d5feeab to your computer and use it in GitHub Desktop.
Save mheadd/66e0402ee24b6c9ff08eb3d78d5feeab to your computer and use it in GitHub Desktop.
Dockerfile to run Drupal 7
FROM php:5.5-apache
RUN a2enmod rewrite
# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install zip \
&& docker-php-ext-install gd mbstring pdo pdo_mysql pdo_pgsql
WORKDIR /var/www/html
# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 7.36
ENV DRUPAL_MD5 98e1f62c11a5dc5f9481935eefc814c5
RUN curl -fSL "http://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \
&& tar -xz --strip-components=1 -f drupal.tar.gz \
&& rm drupal.tar.gz \
&& chown -R www-data:www-data sites
@mheadd
Copy link
Author

mheadd commented Mar 9, 2021

Download this Dockerfile, build and run:

~$ docker build -t {user}/drupal-7 -f Dockerfile .
~$ docker run -p 8080:80 -d {user}/drupal-7

This will launch an instance of Drupal 7 on http://127.0.0.1:8080

Download the 7.x version of the Drupal Markdown Exporter from here.

@onelittlebecca
Copy link

ahh, very cool! wondering how the exporter plays with drupal as more modules are added and the content modeling gets more complex.

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