Skip to content

Latest commit

 

History

History
73 lines (56 loc) · 1.51 KB

README.md

File metadata and controls

73 lines (56 loc) · 1.51 KB

Docker Nginx for Drupal

Nginx and PHP-fpm configured for Drupal, with

Tags:

  • latest, php-7.1.x - Latest 7.1 from ppa:ondrej
  • php-7.0.x - Latest 7.0 from ppa:ondrej
  • php-5.6.x - Latest 5.6 from ppa:ondrej
  • php-5.5.x - Latest 5.5 from ppa:ondrej

See Drupal Development with Docker Compose | Chapter Three.

Build

Extend this container as needed, with a Dockerfile

FROM tbfisher/drupal-nginx:php-5.6.x

# Configure files directory.
RUN mkdir -p /var/www_files/public && \
    mkdir -p /var/www_files/private && \
    chown -R www-data:www-data /var/www_files

Use docker compose:

version: '2'
services:

  database:
    image: mariadb:5.5
    networks:
      - backend

  mail:
    image: mailhog/mailhog
    networks:
      - backend

  web:
    build: ../my-drupal-nginx
    ports:
      - "22"
    volumes:
      - "./code:/var/www:rw"
      - "files_public:/var/www_files/public:rw"
      - "files_private:/var/www_files/private:rw"
      - "ssh:/root/.ssh:rw"
    networks:
      - backend

networks:
  backend:
    driver: bridge

volumes:
  database:
    driver: local
  files_public:
    driver: local
  files_private:
    driver: local
  ssh:
    driver: local

Note PHP in this build is configured to send mail to a mailhog container, which captures any outgoing mail and exposes a UI on port 8025.