Select Page

This week, Alfresco released an example Application Developer Framework (ADF) project called Alfresco Content App. While there are still some very important features missing like advanced search capabilities and a solid metadata editing experience, there are already lots of great features and a solid design based on Google’s Material Design.

The project is fully open sourced under the LGPL license. The idea is to get community collaboration on moving this example forward and for folks using Alfresco to have a simple, common shell application to develop their user interfaces from.

This article covers a very minimal set of steps you can take to get this project up and running quickly—assuming you have (or can install) a recent version of docker, git, and node installed.

First you need to clone, install, and build the app. Then, run the following from a terminal:

git clone https://github.com/Alfresco/alfresco-content-app.git
cd alfresco-content-app
npm install
npm run build

Replace the contents of the `docker-compose.yml` file with the following:

version: '3.1'

services:
    app:
        build: '.'
        ports:
            - 3000:80
        depends_on:
            - alfresco
    alfresco:
        image: gui81/alfresco
        ports:
            - 8080:8080

This will spin up an Alfresco container as well as the example application container. It will also make sure that Alfresco is available before the app container starts so that nginx will be able to find the Alfresco container on the network.

Add the following `location` block to the `nginx.conf` file right above the existing `location \ {}` block:

        location /alfresco/ {
            proxy_pass https://alfresco:8080/alfresco/;
            proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
            proxy_redirect off;
            proxy_buffering off;
            proxy_set_header Host            $host;
            proxy_set_header X-Real-IP       $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass_header Set-Cookie;
        }

This makes nginx work as a reverse proxy so that the example application can reach Alfresco without causing CORS issues.

Now you can spin up the stack:

docker-compose up

Docker will download the `gui81/alfresco` docker image and then spin up the two containers defined in the `docker-compose.yml` file.

Once these have loaded completely (took less-than six minutes the first time on my laptop), you can validate the following links:

The last link is the ADF example Alfresco Content Application. You can login with the username `admin` and the password `admin`.

Once you are done, use `Control-C` in your terminal to quit `docker-compose up` and then use the following command to clean things up:

docker-compose down --rmi local

The `–rmi local` flag will cause your `app` image to be removed. The `gui81/alfresco` image will remain so that you don’t have to wait as long the next time you spin up this stack. Subsequent restarts take about three minutes on my laptop.

Pin It on Pinterest

Sharing is caring

Share this post with your friends!