Fin Docksal Project Tut
This reference article assumes that docksal is already installed.
Start New Project
-
Make sure docksal is installed and if not linux, (mac or windows) , running on a vm.
-
In projects directory (e.g. sites) make three directories:
$ mkdir ~/projects/myproject
$ mkdir ~/projects/myproject/docroot
$ mkdir ~/projects/myproject/.docksal
-
Navigate to your project folder:
$ cd ~/projects/myproject
-
Insert site code or git clone into;
~/projects/myproject/docroot
-
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)
-
$ fin startStart your container using docksal’s “fin” wrapper:
$ fin start
-
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)
-
Fix db port in config files, in file docksal.env write and save (using example data from above:
MYSQL_PORT_MAPPING='32788:3306'
-
Update config:
$ fin up
-
Check config:
$ fin config show (look for “ports: - 32788:3306/tcp”
-
OPTIONAL, setup sequel pro with data just collected, for example:
-
Checkout site at projectname.docksal. (e.g. berkleejazz.docksal)
-
(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.
-
Do steps 1-10 in the instructions above.
-
Navigate to mysite.docksal in the browser.
-
Follow the installation instructions
-
When you get to the db setup page choose default for dbname andw user/user for username/password
-
Select “Advanced…” put in 192.168.64.100 for host.
-
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
-
In “Advanced…” section put in the portnumber that you got from “$ fin config show”. Eg. host: 192.168.64.100:32768, port: 32768
-
Continue and the site should load.
-
Clear cache. (drush cr)