On Your Site
Local Development
Site Code
Guides
Site Configuration
Content Management
Forms
Form API
Templates
Local Development
Setting up
Prerequisites
You will need to have Docker installed to run the development environment. Although not strictly necessary, it is also a good idea to install NVM to manage different Node versions.
To develop Dijon Platform sites locally, you will need Dijon Platform support to give you the following:
- The Git URL for your site
- The Git URL to pull down the Dijon Platform Development Environment
- A
config.php
file.
Download the code
Once you have the prerequisites you can progress with setting up your environment.
Clone the development environment repository
Replace the Git URL with the Dijon Platform development environment Git URL.
git clone git@gitserver.com:dijon/dijon/devenv/dijon.git
Move into the Dijon Platform developer environment directory
cd dijon
Ensure there is a sites directory
mkdir -p sites
Move into the sites directory
cd sites
Clone the Git URL for your site
git clone git@gitserver.com:dijon/dijon/sites/mysite.git
Move back to the Dijon Platform Developer Environment directory
cd ..
Copy in the config.php you have been given
cp ~/Downloads/dijon_config.php config.php
Build the Docker images
docker-compose build
Run the Docker environment
docker-compose up -d
Change file permissions
mkdir -p var/doctrine
sudo chmod -R 777 var
Connect to the Docker environment
docker exec -it dijon_php_1 bash
Install Composer
https://getcomposer.org/download/
Install Composer dependencies
php composer.phar install
Setup your site
php vendor/bin/phinx migrate
php vendor/bin/phinx seed:run
Exit Docker environment
exit
Add the site to the hosts database
Add the following to your /etc/hosts
file, replace site with the name of your
site.
127.0.0.1 admin.dijon.local
127.0.0.1 site.local.dijon.host
Congratulations your environment is set up.