Skip to content

Commit bb0cd4c

Browse files
authored
Add Docker Compose sample file and instructions (#21)
* Added Docker Compose files * #20 Adding notes to readme file for Docker Compose * #20 added folder placeholders and improved documentation.
1 parent 781ef9b commit bb0cd4c

File tree

6 files changed

+116
-0
lines changed

6 files changed

+116
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ docker run -p 80:8080 -p 443:8443 -itd --rm --env-file scripts/env.sh --name dis
5959
| --env-file | Environment file to bind to the container |
6060
| --name dispatcher | assign name "dispatcher" to the container, consider setting a different name per project. |
6161

62+
### Using Docker Compose
63+
64+
Provided `docker-compose.yaml` can be modified to suit your needs. In a typical scenario you would incorporate it to your
65+
own Docker Compose configuration.
66+
67+
You can start dispatcher with Docker Compose using script `dispatcher-docker-compose`
68+
69+
Following folders are mounted from the host os to make it easier to inspect cached files and monitor log files.
70+
71+
| Folder | |
72+
| -------------------- | ------------------------------------------------------------ |
73+
| mnt/author_docroot | Author cached files |
74+
| mnt/publish_docroot | Publish cached files |
75+
| mnt/log | Dispatcher logs |
76+
77+
6278
## Checking the container's current state
6379

6480
```shell

dispatcher-docker-compose

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/sh
2+
3+
VERSION="ams/2.6"
4+
PATH_TO_CONF="etc/httpd"
5+
6+
if [ ! -d $(pwd)/$VERSION/$PATH_TO_CONF/conf ]; then
7+
echo "**** ERROR ****"
8+
echo "This script is supposed to be run in the root directory of the dispatcher project, "
9+
echo "though we could not find a directory ./$VERSION/$PATH_TO_CONF/conf conf from the current directory."
10+
echo "Please change to the projects main directory and try again."
11+
echo ""
12+
exit 1
13+
fi
14+
15+
echo ""
16+
echo "Starting dispatcher, mounting local configuration from ./$VERSION/$PATH_TO_CONF ..."
17+
echo " Open your browser at http://publish.docker.local/content/we-retail/us/en.html "
18+
echo " **** Press Ctrl-C to stop **** "
19+
echo ""
20+
21+
# copy sample we-retail files
22+
cp sample/weretail.vhost $VERSION/etc/httpd/conf.d/available_vhosts
23+
cp sample/weretail_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/available_farms/100_weretail_publish_farm.any
24+
cp sample/weretail_filters.any $VERSION/etc/httpd/conf.dispatcher.d/filters
25+
26+
# create and link up default enabled vhosts
27+
if [ ! -d $VERSION/etc/httpd/conf.d/enabled_vhosts ]; then
28+
mkdir $VERSION/etc/httpd/conf.d/enabled_vhosts
29+
fi
30+
31+
ln -Fs ../available_vhosts/aem_author.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_author.vhost
32+
ln -Fs ../available_vhosts/aem_flush_author.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_flush_author.vhost
33+
ln -Fs ../available_vhosts/aem_publish.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_publish.vhost
34+
ln -Fs ../available_vhosts/aem_flush.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_flush.vhost
35+
ln -Fs ../available_vhosts/aem_health.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_health.vhost
36+
ln -Fs ../available_vhosts/weretail.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/weretail.vhost
37+
38+
# create and link up default enabled farms
39+
if [ ! -d $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms ]; then
40+
mkdir $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms
41+
fi
42+
ln -Fs ../available_farms/000_ams_catchall_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/000_ams_catchall_farm.any
43+
ln -Fs ../available_farms/001_ams_author_flush_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_author_flush_farm.any
44+
ln -Fs ../available_farms/001_ams_publish_flush_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_publish_flush_farm.any
45+
ln -Fs ../available_farms/002_ams_author_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/002_ams_author_farm.any
46+
ln -Fs ../available_farms/002_ams_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/002_ams_publish_farm.any
47+
48+
# set up sample configs
49+
ln -Fs ../available_farms/100_weretail_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/100_weretail_publish_farm.any
50+
51+
# start dispatcher with docker-compose
52+
docker-compose up -d
53+

docker-compose.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: "3.7"
2+
services:
3+
4+
dispatcher:
5+
image: dispatcher
6+
container_name: dispatcher
7+
environment:
8+
- DISP_ID=docker
9+
## Replace value with the Author IP and Port you are using:
10+
- AUTHOR_IP=host.docker.internal
11+
- AUTHOR_PORT=4502
12+
- AUTHOR_DEFAULT_HOSTNAME=author.docker.local
13+
- AUTHOR_DOCROOT=/mnt/var/www/author
14+
## Replace value with the Publisher IP and Port you are using:
15+
- PUBLISH_IP=host.docker.internal
16+
- PUBLISH_PORT=4503
17+
- PUBLISH_DEFAULT_HOSTNAME=publish.docker.local
18+
- PUBLISH_DOCROOT=/mnt/var/www/html
19+
## Replace value with the LiveCycle IP and Port you are using:
20+
- LIVECYCLE_IP=127.0.0.1
21+
- LIVECYCLE_PORT=8080
22+
- LIVECYCLE_DEFAULT_HOSTNAME=aemforms-exampleco-dev.adobecqms.net
23+
- LIVECYCLE_DOCROOT=/mnt/var/www/lc
24+
- PUBLISH_FORCE_SSL=0
25+
- AUTHOR_FORCE_SSL=0
26+
## Enable / Disable CRXDE access. Production this should be disabled
27+
- CRX_FILTER=deny
28+
## Allow dispatcher flush from any IP
29+
- DISPATCHER_FLUSH_FROM_ANYWHERE=allow
30+
31+
volumes:
32+
- ./ams/2.6/etc/httpd/conf:/etc/httpd/conf:ro
33+
- ./ams/2.6/etc/httpd/conf.d:/etc/httpd/conf.d:ro
34+
- ./ams/2.6/etc/httpd/conf.dispatcher.d:/etc/httpd/conf.dispatcher.d:ro
35+
- ./ams/2.6/etc/httpd/conf.modules.d:/etc/httpd/conf.modules.d:ro
36+
- ./mnt/author_docroot:/var/www/author:rw
37+
- ./mnt/publish_docroot:/var/www/html:rw
38+
- ./mnt/log:/var/log/httpd:rw
39+
tmpfs:
40+
- /tmp
41+
ports:
42+
- 80:8080
43+
- 443:8443
44+

mnt/author_docroot/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Folder for Author cache

mnt/log/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Folder for Dispatcher logs

mnt/publish_docroot/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Folder for Publisher cache

0 commit comments

Comments
 (0)