2017-11-15 15:36:36 +00:00

2.2 KiB

Using with Docker

This article assumes you are familiar with Docker and know how to create images and containers.

You can create a Docker image to run Alfresco Content App in the container.

Building from source code

You need to run the following commands to build the project from the source code:

npm install
npm run build

That produces a build in the "dist" folder that you can use with a Docker image.

Also, you may need to update the `dist/app.config.json` file with the settings relevant to your scenario.

Creating an image

The Content Application provides a "Dockerfile" file in the repository root. You can build the image with the following command:

docker image build -t content-app .

Running image in a container

To run the image locally, you can use the following command:

docker container run -p 80:80 --rm content-app

Navigate to "http://localhost" to access the running application.

Docker Compose file

You can also use the "docker-compose" file for local development and testing. To build and run container run the following command in the root project folder:

docker-compose up

To perform a cleanup operation, use the next command:

docker-compose down --rmi all

Navigate to "http://localhost:3000" to access the running application.

Please keep in mind that you should manually build the project every time you want to publish the image or run it locally with the container.

Using with local ACS setup

If you run ACS at port 8080 as a Docker container (typical development configuration), you can use the following command to build the project before creating an image:

npm run build:dev

The command above updates the "dist/app.config.json" file to point the Content App to "http://localhost:8080" upon startup. Alternatively, you can change the configuration file manually before generating an image.

So the development workflow, in this case, is going to be:

npm run build:dev
docker-compose up

Navigate to "http://localhost:3000" to access the running application.

To perform a cleanup operation, use the next command:

docker-compose down --rmi all