This file contains tips and tricks to help with local development of the calendar system. Please add to it as you find 'gotchas' or tips.
By moving to docker, your local development should run much more like
production and dependencies (like setting up an LDAP endpoint) are handled
automatically. docker-compose.yml
(and it's cousin docker-compose.prod.yml
)
contain the definitions of our docker 'environment', allowing (once
docker-compose and docker are setup) anyone to simply run docker compose up
and start a local calendar system.
The local folder is mapped (volume bind) through docker, so for most cases changes are immediately visible (no restart / reload required). Exceptions to this include:
- Changes to docker (
docker-compose.yml
orDockerfile
)- Docker has to be restarted for these to take effect. In some cases additional steps are needed to clean up the docker environment.
- Changes to composer (PHP requirements)
- Since the composer install happens at 'build' time, a new container has to be built for those changes to take place.
We also local bind a few folders to make development easier:
logs/www
will contain the logs generated by Cake PHPerror.log
is a good place to look for details when Cake throws an error
logs/var/apache2
contains the apache logserror.log
can be useful if your php system isn't starting (note that not defined errors are typical in this file and should be ignored)access.log
logs the requests that reach the web server (a good place to start if you're not getting the expected response)
vendor
are all the dependencies installed from Composer and Cake PHP. For the most part, you'll ignore this but having it mapped outside of the container allows some IDEs to enable better auto-complete etc.
When someone understands how we're using Xdebug can they please update this section?
-
I get
open dms-ad-openldap/docker-compose.yml: no such file or directory
- You've likely skipped a step in the setup and didn't get a recursive clone
of the repo. Run
git submodule update --init
to correct it (and consider re-reading the quick start 😉)
- You've likely skipped a step in the setup and didn't get a recursive clone
of the repo. Run
-
I keep getting errors like
Error response from daemon: error while creating mount source path ... permission denied
- This seems to happen on *nix environments and you can either continue running
docker compose up
until all the local volumes are created (logs/www
,logs/var
,tmp
,vendor
). Or you can run./setup.sh
which will create those paths for you ahead of time.
- This seems to happen on *nix environments and you can either continue running
-
I get an error from
docker compose up
thatDEBUG
has an invalid value- Please make sure you are running version 2+ of
docker-compose
(check withdocker compose -v
)
- Please make sure you are running version 2+ of
-
Docker won't start with errors like
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: permission denied: unknown
- The scripts in
.docker/
(*.sh
) should be marked as executable (you can runchmod +x .docker/*.sh
to fix)
- The scripts in
-
How do we test with traefik locally?
- I'm not sure (yet!) ... someone will have to update this with more details
These won't apply to most people, but are being kept for anyone that wants to run the PHP code directly (without docker).
- Download Composer or update
composer self-update
. - Run
php composer.phar install
.
You should now have all of the components needed to run a local version of the
calendar application. Check this by ensuring that the vendor
directory in
the root folder contains several folders with imported packages.
Use migrate command to create database. There are also several database seeders which can add some initial data to your database for event categories, committees, configurations, prerequisites, rooms and tools. More information on how to run those seeders is available in the CakePHP Cookbook
Copy the config/app.default.php
file to config/app.php
. This file is a
mirror of the config file on the production server with accounts and other
sensitive information removed.
The .htaccess-sample
file in the root directory can, in most cases, be
renamed to .htaccess
and provide everything needed for CakePHP to route
necessary traffic to the webroot
directory.