Sign inSign up

osuwams/drupal

By osuwams

•Updated 4 days ago

Oregon State University's Drupal Distribution

Image
1

5.9K

osuwams/drupal repository overview

⁠How to use this image

At a minimum you will need to run

docker run --name joe-beaver -d osuwams/drupal

⁠Environment Variables

You can either set these in your shell or use the -e or --env flags at run time.

docker run -d \
-e DRUPAL_DBUSER=myuser \
-e DRUPAL_DBPASS=mypass \
-e DRUPAL_DBNAME=mydb \
--name joe-beaver osuwams/drupal

If you are going to run a MySQL compatible database on a different host/port then run with

docker run -d \
-e DRUPAL_DBUSER=myuser \
-e DRUPAL_DBPASS=mypass \
-e DRUPAL_DBNAME=mydb \
-e DRUPAL_DBPORT=3306 \
-e DRUPAL_DBHOST=localhost \
--name joe-beaver osuwams/drupal

If you wish to use OSU Profiles and Connect for Profile Data you'll need LDAP Credentails and to update your Run with

docker run -d \
-e DRUPAL_DBUSER=myuser \
-e DRUPAL_DBPASS=mypass \
-e DRUPAL_DBNAME=mydb \
-e DRUPAL_DBPORT=3306 \
-e DRUPAL_DBHOST=localhost \
-e LDAP_BIND_DN=some_bind_dn \
-e LDAP_PIND_PW=your_bind_password \
--name joe-beaver osuwams/drupal
⁠Variable List

There are three environment variables are required if you want to have the container auto configure the Drupal database configuration.

⁠DRUPAL_DBUSER

This variable tells Drupal what the user is to connect to the database.

⁠DRUPAL_DBPASS

This variable tells Drupal what password to use to connect to the database.

⁠DRUPAL_DBNAME

This variable tells Drupal what database to use.

⁠DRUPAL_DBPORT

This is an optional variable and if left off will default to 3306.

⁠DRUPAL_DBHOST

This is optional variable and if left off will default to localhost

⁠DRUPAL_MEMCACHE

Set this to true to enable Memcache support.

⁠DRUPAL_MEMCACHEHOST

Set this only if your Memcache host is not localhost/127.0.0.1

⁠DRUPAL_DOMAIN_HOST

If you are using a multisite database and files this will create a symbolic link in the sites directory to make files work.

⁠LDAP_BIND_DN & LDAP_BIND_PW

This is required to use Profiles syncing

⁠Volumes

There are different reasons to use volume mounts in docker. If you need some parts of the Drupal site to persist a docker image upgrade specify them. There are a few examples below in the yaml config.

Docker allow provides a bind mount option to bring local folders from the host matching into the running container.

Drupal Private files are configured to be under /var/www/private_files

⁠Via Docker Stack Deploy and Docker Compose

version: "3.7"

services:
  database:
    image: mariadb:10.1
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: drupal
      MYSQL_USER: drupal
      MYSQL_PASSWORD: drupal
    # To bring in your own database uncomment the following and either make the mariadb-init folder or update the system mount
    # volumes:
      # - ./mariadb-init:/docker-entrypoint-initdb.d
  drupal:
    image: osuwams/drupal:7-apache
    ports:
      - 8080:80
    volumes:
      - /var/www/html/sites/all/modules
      - /var/www/html/sites/all/themes
      - /var/www/html/sites/default
      # Below are other volumes that can be used.
      # - ./files:/var/www/html/sites/default/files
      # - ./local-theme:/var/www/html/sites/default/themes
      # - ./local-modules:/var/www/html/sites/default/modules
    environment:
      DRUPAL_DBHOST: database
      DRUPAL_DBUSER: drupal
      DRUPAL_DBNAME: drupal
      DRUPAL_DBPASS: drupal
      DRUPAL_DBPORT: 3306
      LDAP_BIND_DN: your_bind_dn
      LDAP_BIND_PW: your_bind_password
      DRUPAL_MEMCACHE:true
      DRUPAL_MEMCACHEHOST:cache
    depends_on:
      - database
  cache:
    image: memcached:1

Copy the code above to either a docker-compose.yml or a stack.yml file (or really any *.yml file of your choosing). Docker Compose will look for a docker-compose.yml in the directory you are currently in.

Run docker-compose up -f <yourname>.yml -d or docker stack deploy -c stack.yml wait for the stack to finish deploying and you can access your site at http://localhost:8080, or http://host-ip:8080

Tag summary

Content type

Image

Digest

sha256:d3b9f449b…

Size

246.1 MB

Last updated

7 months ago

docker pull osuwams/drupal