Contao 3.5.X – PHP 7.2 Docker Image for Modul Development

1. Create a empty Folders data and database.

2. Create docker-compose.yml

version: '3'
services:
  php:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - ./data:/var/www/html/
    depends_on:
      - db
    ports:
      - "3333:80"
  db:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: my_secret_pw_shh
      MYSQL_DATABASE: test_db
      MYSQL_USER: devuser
      MYSQL_PASSWORD: devpass
      MYSQL_ROOT_HOST: '%'
    restart: always
    ports:
      - "9906:3306"
    volumes:
      - ./database:/var/lib/mysql

volumes:
  db:
    driver: local
Continue reading “Contao 3.5.X – PHP 7.2 Docker Image for Modul Development”

Docker – LAMP Mariadb container fails to launch

Here is the Log Information one of them:

xxx-xx-xx xx:xx:xx 3333333333 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
-xx-xx xx:xx:xx 3333333333 [ERROR] Plugin 'InnoDB' init function returned error.

For fixing set your volumes from mariadb with local driver.

version: '3'
services:
  php-apache:
    build:
      context: ./php-apache
    ports:
      - 80:80
    volumes:
      - ./www:/var/www/html
    links:
      - 'mariadb'

  mariadb:
    image: mariadb:10.1
    restart: always
    volumes:
      - mariadb:/var/lib/mysql
    environment:
      TZ: "Europe/Rome"
      MYSQL_ALLOW_EMPTY_PASSWORD: "no"
      MYSQL_ROOT_PASSWORD: "rootpwd"
      MYSQL_USER: 'testuser'
      MYSQL_PASSWORD: 'testpassword'
      MYSQL_DATABASE: 'testdb'

volumes:
  mariadb:
    driver: local