-
Adobe experience manager is a content management system which in a nutshell is an application that allows us to create web sites to be consumed by end users. You might be familiar with other such applications like wordpress or drupal which serves the same purpose
-
A typical deployment would be comprised of two AEM instances, the author instance used for creating and modifying content, the publish instance which serves the content and finally we have a dispatcher which is a static web server used for caching, load balancing and some security purposes.
-
We can configure an AEM instance to work as an author or publish instance by either changing the file name for the jar file
-
java -jar cq-author-4502.jar java -jar cq-publish-4503.jar
-
Or by using the run modes to configure the instance
-
java -jar cq-quickstart.jar -Dsling.run.modes=author -p 4502 java -jar cq-quickstart.jar -Dsling.run.modes=publish -p 4503
- 1.Pre-reqs
-
Have Java installed (If you want to start AEM outside docker)
-
Have an AEM instance jar and the license.properties filesAnd docker installed
-
- 2.Create a base AEM image in docker so it can be reused
-
Start from a clean ubuntu image
FROM ubuntu
-
Create default/working directory
WORKDIR /opt/aem
-
Install Oracle's Java 8 inside the docker container
RUN apt-get update && \ apt-get install -y curl && \ apt-get install -y software-properties-common && \ add-apt-repository ppa:openjdk-r/ppa && \ apt-get update && \ apt-get install -y openjdk-8-jdk && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /var/cache/oracle-jdk8-installer
-
Copy the license and jar file into the image
ADD license.properties ./ ADD cq-quickstart-6.3.0.jar cq-quickstart.jar
-
Unpack the jar for future use on other images, child images should use the cq-quickstart.jar file when interacting with AEM
RUN java -jar cq-quickstart.jar -unpack
-
Build the image
docker build -t aem .
-
- 3.
-
Use the base image
FROM aem
-
Export the port number
EXPOSE PORT-NUMBER
-
Start AEM using the same port as above and provide the run mode value: author or publish and for the port: 4502 or 4503
ENTRYPOINT ["java", "-Xmx1024M", "-jar", "cq-quickstart.jar", "-Dsling.run.modes=RUN-MODE", "-p", "PORT-NUMBER"]
-
Build the image and define the name for the type of instance: author or publish
docker build -t INSTANCE-TYPE . docker build -t author .
-
And finally start the container using the name for the type of instance: author or publish and map the corresponding ports the port: 4502 or 4503
docker run -p PORT-NUMBER:PORT-NUMBER INSTANCE-TYPE docker run -p 4502:4502 author
-
- 4.Create a docker container for the dispatcher using default configurations
-
Use an apache image as a base (This one already have some configurations like the port 80 already exposed)
FROM httpd:2.4
-
Create default/working directory
WORKDIR /usr/src/app
-
Download the dispatcher module
ADD https://www.adobeaemcloud.com/content/companies/public/adobe/dispatcher/dispatcher/_jcr_content/top/download_8/file.res/dispatcher-apache2.4-linux-x86-64-4.2.3.tar.gz ./dispatcher/
-
Unzip it and then copy the module file into apache's modules folder
RUN tar -xzvf ./dispatcher/dispatcher-apache2.4-linux-x86-64-4.2.3.tar.gz -C ./dispatcher && \ cp ./dispatcher/dispatcher-apache2.4-4.2.3.so /usr/local/apache2/modules/mod_dispatcher.so
-
Copy a local version of the dispatcher.any file already modified to work with the publish instance, take into account that the configuration on that file is expecting that you are starting the containers using docker-compose and that the service for the publish instance is also called publish.
If you need another name or to start the container using just docker change any text matching the text "publish" to the new one or the ip of your publish container
ADD dispatcher.any /usr/local/apache2/conf/dispatcher.any
-
Copy a local version of the httpd.conf file already modified to use the dispatcher module.
COPY httpd.conf /usr/local/apache2/conf/httpd.conf
-
Start all the containers using docker-compose
docker-compose up
-
- 5.
Comentarios
Publicar un comentario