Sign inSign up

swarmnyc/drupal

By swarmnyc

•Updated about 7 years ago

The image is based on drupal and added composer, drush and libraries

Image
0

188

swarmnyc/drupal repository overview

⁠This is the Dockerfile

FROM drupal

RUN apt-get update && apt-get install -y \
  wget \
  libpng-dev \
  zip \
  unzip \
  git

RUN docker-php-ext-install pdo pdo_mysql mysqli bcmath gd

RUN curl -O https://raw.githubusercontent.com/pantheon-systems/terminus-installer/master/builds/installer.phar && php installer.phar install

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
  php composer-setup.php && \
  mv composer.phar /usr/local/bin/composer && \
  php -r "unlink('composer-setup.php');"

RUN wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar && \
  chmod +x drush.phar && \
  mv drush.phar /usr/local/bin/drush

COPY apache-drupal.conf /etc/apache2/sites-enabled/000-default.conf

WORKDIR /var/www

⁠The apache-drupal.conf

<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/web

	<Directory /app/web>
		AllowOverride All
		Require all granted
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

⁠Usage

⁠Directly Use
docker run -it -v ${PWD}:/var/www -p 8080:80 swarmnyc/drupal bash
⁠Use with compose
version: '3.7'

services:
  web:
    image: swarmnyc/drupal
    volumes:
      - ./:/var/www
    environment:
      DB_DATABASE: app
      DB_HOST: db
      DB_PASSWORD: password
      DB_USER: root
    ports:
      - 8080:80
    links:
      - db
    depends_on: 
      - db
  db:
    image: mariadb
    ports:
      - 3306:3306
    environment:
      MYSQL_DATABASE: app
      MYSQL_ROOT_PASSWORD: password
    volumes: 
      - db-data:/var/lib/mysql
volumes: 
    # save data to the volume, so the data can persistent
    db-data:
  • db is optional. You can remove if you don't want to use it along with a new mysql container

Tag summary

Content type

Image

Digest

Size

223.6 MB

Last updated

about 7 years ago

docker pull swarmnyc/drupal