diff --git a/README.md b/README.md index 8919406..f9c90b0 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,22 @@ docker run -p 80:8080 -p 443:8443 -itd --rm --env-file scripts/env.sh --name dis | --env-file | Environment file to bind to the container | | --name dispatcher | assign name "dispatcher" to the container, consider setting a different name per project. | +### Using Docker Compose + +Provided `docker-compose.yaml` can be modified to suit your needs. In a typical scenario you would incorporate it to your +own Docker Compose configuration. + +You can start dispatcher with Docker Compose using script `dispatcher-docker-compose` + +Following folders are mounted from the host os to make it easier to inspect cached files and monitor log files. + +| Folder | | +| -------------------- | ------------------------------------------------------------ | +| mnt/author_docroot | Author cached files | +| mnt/publish_docroot | Publish cached files | +| mnt/log | Dispatcher logs | + + ## Checking the container's current state ```shell diff --git a/dispatcher-docker-compose b/dispatcher-docker-compose new file mode 100755 index 0000000..e96be61 --- /dev/null +++ b/dispatcher-docker-compose @@ -0,0 +1,53 @@ +#!/bin/sh + +VERSION="ams/2.6" +PATH_TO_CONF="etc/httpd" + +if [ ! -d $(pwd)/$VERSION/$PATH_TO_CONF/conf ]; then + echo "**** ERROR ****" + echo "This script is supposed to be run in the root directory of the dispatcher project, " + echo "though we could not find a directory ./$VERSION/$PATH_TO_CONF/conf conf from the current directory." + echo "Please change to the projects main directory and try again." + echo "" + exit 1 +fi + +echo "" +echo "Starting dispatcher, mounting local configuration from ./$VERSION/$PATH_TO_CONF ..." +echo " Open your browser at http://publish.docker.local/content/we-retail/us/en.html " +echo " **** Press Ctrl-C to stop **** " +echo "" + +# copy sample we-retail files +cp sample/weretail.vhost $VERSION/etc/httpd/conf.d/available_vhosts +cp sample/weretail_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/available_farms/100_weretail_publish_farm.any +cp sample/weretail_filters.any $VERSION/etc/httpd/conf.dispatcher.d/filters + +# create and link up default enabled vhosts +if [ ! -d $VERSION/etc/httpd/conf.d/enabled_vhosts ]; then + mkdir $VERSION/etc/httpd/conf.d/enabled_vhosts +fi + +ln -Fs ../available_vhosts/aem_author.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_author.vhost +ln -Fs ../available_vhosts/aem_flush_author.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_flush_author.vhost +ln -Fs ../available_vhosts/aem_publish.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_publish.vhost +ln -Fs ../available_vhosts/aem_flush.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_flush.vhost +ln -Fs ../available_vhosts/aem_health.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_health.vhost +ln -Fs ../available_vhosts/weretail.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/weretail.vhost + +# create and link up default enabled farms +if [ ! -d $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms ]; then + mkdir $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms +fi +ln -Fs ../available_farms/000_ams_catchall_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/000_ams_catchall_farm.any +ln -Fs ../available_farms/001_ams_author_flush_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_author_flush_farm.any +ln -Fs ../available_farms/001_ams_publish_flush_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_publish_flush_farm.any +ln -Fs ../available_farms/002_ams_author_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/002_ams_author_farm.any +ln -Fs ../available_farms/002_ams_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/002_ams_publish_farm.any + +# set up sample configs +ln -Fs ../available_farms/100_weretail_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/100_weretail_publish_farm.any + +# start dispatcher with docker-compose +docker-compose up -d + diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..b15522f --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,44 @@ +version: "3.7" +services: + + dispatcher: + image: dispatcher + container_name: dispatcher + environment: + - DISP_ID=docker + ## Replace value with the Author IP and Port you are using: + - AUTHOR_IP=host.docker.internal + - AUTHOR_PORT=4502 + - AUTHOR_DEFAULT_HOSTNAME=author.docker.local + - AUTHOR_DOCROOT=/mnt/var/www/author + ## Replace value with the Publisher IP and Port you are using: + - PUBLISH_IP=host.docker.internal + - PUBLISH_PORT=4503 + - PUBLISH_DEFAULT_HOSTNAME=publish.docker.local + - PUBLISH_DOCROOT=/mnt/var/www/html + ## Replace value with the LiveCycle IP and Port you are using: + - LIVECYCLE_IP=127.0.0.1 + - LIVECYCLE_PORT=8080 + - LIVECYCLE_DEFAULT_HOSTNAME=aemforms-exampleco-dev.adobecqms.net + - LIVECYCLE_DOCROOT=/mnt/var/www/lc + - PUBLISH_FORCE_SSL=0 + - AUTHOR_FORCE_SSL=0 + ## Enable / Disable CRXDE access. Production this should be disabled + - CRX_FILTER=deny + ## Allow dispatcher flush from any IP + - DISPATCHER_FLUSH_FROM_ANYWHERE=allow + + volumes: + - ./ams/2.6/etc/httpd/conf:/etc/httpd/conf:ro + - ./ams/2.6/etc/httpd/conf.d:/etc/httpd/conf.d:ro + - ./ams/2.6/etc/httpd/conf.dispatcher.d:/etc/httpd/conf.dispatcher.d:ro + - ./ams/2.6/etc/httpd/conf.modules.d:/etc/httpd/conf.modules.d:ro + - ./mnt/author_docroot:/var/www/author:rw + - ./mnt/publish_docroot:/var/www/html:rw + - ./mnt/log:/var/log/httpd:rw + tmpfs: + - /tmp + ports: + - 80:8080 + - 443:8443 + diff --git a/mnt/author_docroot/README.md b/mnt/author_docroot/README.md new file mode 100644 index 0000000..01d6c7c --- /dev/null +++ b/mnt/author_docroot/README.md @@ -0,0 +1 @@ +Folder for Author cache \ No newline at end of file diff --git a/mnt/log/README.md b/mnt/log/README.md new file mode 100644 index 0000000..37c5729 --- /dev/null +++ b/mnt/log/README.md @@ -0,0 +1 @@ +Folder for Dispatcher logs \ No newline at end of file diff --git a/mnt/publish_docroot/README.md b/mnt/publish_docroot/README.md new file mode 100644 index 0000000..b60171d --- /dev/null +++ b/mnt/publish_docroot/README.md @@ -0,0 +1 @@ +Folder for Publisher cache \ No newline at end of file