There are great resources inside this Community on how to deploy Alfresco 6 using Docker Compose
Although some real environments will require Kubernetes deployment, many others will be managed with a simple Docker Composition. This post is based in Alfresco 201804-EA release, but these instructions can be applied on many other Alfresco 6 releases.
This post includes sample configuration for every point, but you can check detailed and running configuration at 201804-EA Docker template
Alfresco 6 provides several Docker Images to build every container for different services:
Docker relies on external storage to persist information. When running an Alfresco server, repository, database and search containers are storing data that needs to be persisted.
A volumes tag must be added in docker-compose.yml file to every container definition to map local storage from your server with logical storage inside the container.
alfresco:
volumes:
- alf-repo-data:/usr/local/tomcat/alf_data
postgres:
volumes:
- postgres-data:/var/lib/postgresql/data
solr6:
volumes:
- solr-data:/opt/alfresco-search-services/data
volumes:
alf-repo-data:
external: true
postgres-data:
external: true
solr-data:
external: true
This code is using named volumes. In case they didn't exists, they can be created by using following shell lines:
$ docker volume create alf-repo-data
$ docker volume create postgres-data
$ docker volume create solr-data
Once this configuration is applied, your data will survive any Docker or Server re-starting.
Docker uses internal ports for containers and it exposes to the server a mapping of these ports. In order to configure Alfresco protocols, ports exposition needs to be declared in Alfresco Repository Dockerfile...
EXPOSE 2121 1143 2525 1445 1137/udp 1138/udp 1139
... and mapping needs to be declared in docker-compose.yml
alfresco:
ports:
- 21:2121 # FTP port
- 25:2525 # SMTP port
- 143:1143 # IMAP port
- 445:1145 # CIFS
- 137:1137/udp # CIFS
- 138:1138/udp # CIFS
- 139:1139 # CIFS
It's also required to open these ports in the firewall of the operative system hosting Docker.
Once this configuration is applied, your Alfresco server will be accessed by FTP, SMTP, IMAP and CIFS.
Web applications ports (AJP 8009 for Alfresco, AJP 8009 for Share and HTTP 8983 for Solr) must be also exposed to configure the Proxy at httpd container.
ProxyPass "/share" "ajp://share:8009/share"
ProxyPassReverse "/share" "ajp://share:8009/share"
ProxyPass "/solr" "http://solr6:8983/solr"
ProxyPassReverse "/solr" "http://solr6:8983/solr"
ProxyPass "/alfresco" "ajp://alfresco:8009/alfresco"
ProxyPassReverse "/alfresco" "ajp://alfresco:8009/alfresco"
It can be used any other Web Container (as NGINX) to provide such configuration.
Once this configuration is applied, your Alfresco server will be accessed by using the same HTTP Port. In the next point the use of port 443 for HTTPs is detailed.
To provide real SSL Certificates, assets folder can be filled with working files:
Otherwise, it can be configured an external Docker volume to hold these certificates.
Listen 443
<VirtualHost *:443>
ServerName alfresco.keensoft.es
SSLEngine on
SSLCertificateFile /usr/local/apache2/conf/server.crt
SSLCertificateKeyFile /usr/local/apache2/conf/server.key
SSLCACertificatePath /etc/pki/tls/certs/
SSLOptions +StdEnvVars +ExportCertData
</VirtualHost>
Once this configuration is applied, your Alfresco server will be accessed by HTTPs.
Folders to hold AMP or JAR modules has been provided.
alfresco/target/amps
alfresco/target/jars
share/target/amps_share
share/target/jars
Every addon copied into this folders will be deployed in the container.
If further configuration is required in alfresco-global.properties, Dockerfile can be modified to add pairs of property=value blocks
# Add services configuration to alfresco-global.properties
RUN echo -e '\n\
property=value\n\
\n\
' >> /usr/local/tomcat/shared/classes/alfresco-global.properties
Once this configuration is applied, your Alfresco server will provide features from installed modules.