The repository contains a Docker setup for developing os2display.
Clone this project, then customize _variables.source
. You should at the very least update ADMIN_REPOSITORY
and ADMIN_REPOSITORY_BRANCH
to reference your admin
fork.
You must make the following changes to your admin
fork to be compatible with the docker-setup.
First add support for patches during composer-install.
docker-compose run \
-e COMPOSER_MEMORY_LIMIT=-1 \
admin-php \
composer require cweagans/composer-patches:~1.0
(The composer dependencygraph is quite large so we need to cancel the memory-limit an keep our fingers crossed, you probably need about 3-4 gigabytes of available memory in the container).
Add a patch to support non-localhost elasticsearch (until os2display/admin#20 gets merged).
{
"require": {
"cweagans/composer-patches": "~1.0",
},
"extra": {
"patches": {
"os2display/admin-bundle": {
"Switch to supporting a separate configuration for the public search hostname": "patches/admin-bundle-public-search.patch"
}
}
}
}
To get started you need the following:
- Install Docker
- Install Docker Compose
- Install Dory. - Something similiar will do. dnsmasq, or another project that can provide access to the containers via the
VIRTUAL_HOST
environments-specified in docker-compose. dory up
make clone-admin
make reset-dev
ormake reset-dev-nfs
(see below)make run-gulp
When you have made changes to slides or screens you might want to run make run-gulp
again.
After reset the site will be available at https://admin.reload-os2display.docker
Docker For Mac is notoriously slow when it comes to "bind" mounts. In order to support this better the setup supports mounting the code-base via NFS with two caveats.
- A compatible /etc/exports has to be set up in advance, eg. sees https://forums.docker.com/t/nfs-native-support/48531
- The mount will display all files as being owned by the same user, any attempts to change the ownership or permissions will be rejected. This may cause problems if you need your code to handle ownerships
The setup is currently unable to auto-detect whether to use NFS, so instead you have to explicitly reset using
make reset-dev-nfs
make reset-release
See Makefile and the documentation for more details or feel free to contact the authors for more details.