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:
- Repository, named alfresco/alfresco-content-repository-community:6.0.5-ea
- Share, named alfresco/alfresco-share:6.0.a
- Currently not available in GitHub
- Database PostgreSQL, named postgres:10.1
- Search SOLR 6, named alfresco/alfresco-search-services:1.1.1
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.
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
- 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.
Configuring SSL Certificates
To provide real SSL Certificates, assets folder can be filled with working files:
- CA.pem - CA Certificate Path
- server.crt - Certificate File
- server.key - Certificate Key File
Otherwise, it can be configured an external Docker volume to hold these certificates.
SSLOptions +StdEnvVars +ExportCertData
Once this configuration is applied, your Alfresco server will be accessed by HTTPs.
Folders to hold AMP or JAR modules has been provided.
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\
' >> /usr/local/tomcat/shared/classes/alfresco-global.properties
Once this configuration is applied, your Alfresco server will provide features from installed modules.
- Original composition from Alfresco release available at https://github.com/Alfresco/acs-community-deployment/blob/6.0.5-ea/docker-compose/docker-compose.yml
- Sample configuration for PROD environments available at https://github.com/keensoft/alfresco-docker-template/tree/master/templates/201804-EA
- Template for Alfresco Community 6 deployment at https://github.com/keensoft/docker-alfresco