Docker Drupal 10

01.03.2023 - Lesezeit: ~1 Minute

Docker Drupal 10 am Port 8001 installieren Dazu wird die Datei $HOME/docker/drupal/docker-compose.yml erstellt

version: '3.3'

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
    volumes:
      - /var/docker/drupal/mysql:/var/lib/mysql
      - /var/docker/drupal/init:/docker-entrypoint-initdb.d
    environment:
      - MYSQL_ROOT_PASSWORD=xxx
      - MYSQL_PASSWORD=yyy
      - MYSQL_DATABASE=drupal
      - MYSQL_USER=drupal

  phpmyadmin:
    image: phpmyadmin
    restart: always
    ports:
        - 8002:80

  app:
    image: drupal
    restart: always
    ports:
      - 8001:80
    volumes:
      - /var/docker/drupal/html/modules:/var/www/html/modules
      - /var/docker/drupal/html/profiles:/var/www/html/profiles
      - /var/docker/drupal/html/themes:/var/www/html/themes
#      - /var/docker/drupal/html/sites:/var/www/html/sites/default
    environment:
      - MYSQL_PASSWORD=yyy
      - MYSQL_DATABASE=drupal
      - MYSQL_USER=drupal
      - MYSQL_HOST=db

Anzeigen ob der Docker läuft

$ docker ps -a
CONTAINER ID   IMAGE               COMMAND                  CREATED          STATUS                       PORTS                                   NAMES
2e3f3a866994   phpmyadmin          "/docker-entrypoint.…"   2 hours ago     Up 2 hours                   0.0.0.0:8002->80/tcp, :::8002->80/tcp   drupal_phpmyadmin_1
1835211c9850   drupal              "docker-php-entrypoi…"   2 hours ago     Up 2 hours                   0.0.0.0:8001->80/tcp, :::8001->80/tcp   drupal_app_1
51cdd0eb14cd   mariadb             "docker-entrypoint.s…"   2 hours ago     Up 2 hours                   3306/tcp                                drupal_db_1

Update Drupal im Docker

$ cd docker/drupal/
$ docker-compose dow
$ docker-compose pull
$ docker-compose up -d
Tags: Drupal Docker Drupal10