Setting up drupal with docker using two containers? nginx and mariadb
I am trying to get a Drupal local development environment up and running using docker.
The site I am working on is live, running on a digital ocean server. When I access that server (ssh -p 1111 @220.127.116.11)
and run (docker ps) I can see two containers running. One is for the nginx-php5-drupal container that I got from here (https://github.com/bnchdrff/dockerfiles)
The other container is a mariadb container that holds the database for the drupal site.
I have run (docker export) on both of these containers, downloaded them and then set them up as images locally, named (mariadb:local) and (bnchdrff/nginx-php5-drupal:latest) respectively
I then run:
sudo docker run -d –name mariadb mariadb:local /sbin/init
sudo docker run -d -p 80:80 -p 2222:22 –name nginx-php5-drupal-bnchdrff –link mariadb:db bnchdrff/nginx-php5-drupal:latest /sbin/init
I then attempt to navigate to localhost:80 and/or localhost in my browser…
Am I doing this right?
My understanding is patchy as I am new to all of this. I think the best thing for me to do is to restart the whole process from exporting the running containers from the live site to running them locally because I swapped out the live nginx-php5-drupal container for the old one from the github repo and I think the person who put the site online customised it…
One Solution collect form web for “Setting up drupal with docker using two containers? nginx and mariadb”
If you are on a MAC OS you’ll need to use the boot2docker ip address.
You can get this by running the following command: boot2docker ip