Docksal for Drupal8

Image

Fin Docksal Project Tut

This reference article assumes that docksal is already installed.

Start New Project

  1. Make sure docksal is installed and if not linux, (mac or windows) , running on a vm.

  2. In projects directory (e.g. sites) make three directories:

        $ mkdir ~/projects/myproject
        $ mkdir ~/projects/myproject/docroot
        $ mkdir ~/projects/myproject/.docksal

  1. Navigate to your project folder:

        $ cd ~/projects/myproject

  1. Insert site code or git clone into; 

         ~/projects/myproject/docroot

  1. Create config files: (optional, but recommended)

        $ fin config generate

 

        To enable xdebug, go into file generated and set:

        1) Set XDEBUG_ENABLED=1 in .docksal/docksal.env in your project.

        2) Apply container configuration with fin project start (fin p start)

 

  1. $ fin startStart your container using docksal’s “fin” wrapper: 

        $ fin start

 

  1. Get host and port info

        show host ip: $ fin vm ip   

        (e.g. returns value 192.168.64.100)       

        show mysql port and more: $ fin ps

       (e.g. returns: berkleejazz_db_1    /entrypoint.sh mysqld Up 0.0.0.0:32788->3306/tcp, for port value of 32788)           

  1. Fix db port in config files, in file docksal.env write and save (using example data from above:

        MYSQL_PORT_MAPPING='32788:3306'

  1. Update config:

        $ fin up

  1. Check config:

       $ fin config show (look for “ports: - 32788:3306/tcp”

  1. OPTIONAL, setup sequel pro with data just collected, for example:

Screen Shot 2017-04-28 at 8.28.54 AM.png

  1. Checkout site at projectname.docksal. (e.g. berkleejazz.docksal)

  2. (Optional) If default php7x breaks site then switch to php5x in docksal.yml:

          cli:

                image: docksal/cli:1.2-php5

 

When Setting up a Drupal 8 Site.

  1. Do steps 1-10 in the instructions above.

  2. Navigate to mysite.docksal in the browser.

  3. Follow the installation instructions

  4. When you get to the db setup page choose default for dbname andw user/user for username/password

  5. Select “Advanced…” put in 192.168.64.100 for host.

  6. Form the “$ fin config show” (step 10 above) information get MYSQL: 192.168.64.100:portnumber (the port number is what you mapped in docksal.env file), eg. 192.168.64.100:32768

  7. In “Advanced…” section put in the portnumber that you got from “$ fin config show”. Eg. host: 192.168.64.100:32768, port: 32768

  8. Continue and the site should load.

  9. Clear cache. (drush cr)