Using Alfresco 201804-EA in a simple PROD environment

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Alfresco 201804-EA in a simple PROD environment

angelborroy
Alfresco Employee
13 6 12.1K

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

Images

Alfresco 6 provides several Docker Images to build every container for different services:

Persistent storage

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.

Ports configuration

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.

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. 

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.

Adding modules

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.

Resources

About the Author
Angel Borroy is Hyland Developer Evangelist. Over the last 15 years, he has been working as a software architect on Java, BPM, document management and electronic signatures. He has been working with Alfresco during the last years to customize several implementations in large organizations and to provide add-ons to the Community based on Record Management and Electronic Signature. He writes (sometimes) on his personal blog http://angelborroy.wordpress.com. He is (proud) member of the Order of the Bee.
6 Comments