X

Docker-compose for joomla development with mysql and redis

Let’s say you just want to have Joomla with its Mysql and also redis infrastructure ready.
And don’t want to bother setting it up manually for each services.

Just make a docker-compose.yaml with the following content and then start it up.


version: '3.1'

services:
  web:
    image: joomla
    restart: always
    links:
      - db:mysql
      - redis:cache
    ports:
      - "80:80"
    volumes:
      - "./html:/var/www/html"
      - "./php/php.ini:/usr/local/etc/php/php.ini"
    environment:
        JOOMLA_DB: ${MYSQL_DB}
        JOOMLA_DB_HOST: db
        JOOMLA_DB_PASSWORD: ${MYSQL_ROOT_PASSWORD}

  db:
    image: mysql:5.6
    ports:
      - "3306:3306"
    restart: always
    volumes:
      - "./mysql:/var/lib/mysql"
    environment:
        MYSQL_DATABASE: ${MYSQL_DB}
        MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}

  redis:
    image: redis
    container_name: cache
    ports:
        - "6379:6379"
    restart: always    

then create an .env file with the content for above parameters.


MYSQL_ROOT_PASSWORD=password # set to whatever here
MYSQL_DB=dbname # set approriate database name here

If you have an pre-compiled quickstart file, just extract it into `html` folder.

Then just start the docker with


docker-compose up -d

During install process at http://localhost/installation
just enter the password and db name credential similar to what have been defined in `.env` file.

Namran Hussin: a soft spoken guy... with exceptional interest in computers and technology. I love to learn new thing and also love to break thing for the sake of learning.. but I do abide to the self-imposed limitation or certain thing such as social thing in life, thing can be done and thing that must be avoided at whatever cost such as drug,illegal tracking, smoke,illicit activity..etc.muahahaha let's share what we had in this short term of the life.! make it worth of the living.~
Related Post
Leave a Comment