It is fairly easy to start DSpace containers in AWS Fargate. AWS Fargate does not permit command line execution within a container, so regular DSpace command line tasks cannot be run.

See https://stackoverflow.com/questions/52310447/is-it-possible-to-ssh-into-fargate-manged-container-instances/52310862#52310862

I verified this limitation in a conversation with an AWS Developer Advocate.


This page describes how to run DSpace docker images on AWS Elastic Container Service (ECS) using AWS Fargate.  

Create an ECS Cluster (specify Fargate when creating the cluster)


Create a Task Definition named "dspace" using "awsvpc" mode

The Task Definition will contain 2 containers "dspace" and "dspacedb"

dspace container

This container will be built from dspace/dspace.

The awsvpc networking does not allow containers to be addressed by hostname, so a localhost reference must be used for the database.

Fortunately, DSpace 6+ allows environment variables to override dspace.cfg and local.cfg settings.  Note the override for db.url.

Port 8080 is exposed.

dspacedb container

This container will be built from dspace/dspace-postgres-pgcrypto

Select "Run Task" to start your task within the cluster you created.

Specify the Fargate launch type.

Select the VPC and Subnet associated with your cluster.

Click to Edit the Security Group so that port 8080 will be accessible.

Customize the Security Group then Click "Run Task".

Select the running task in order to get its IP address

Get the public IP address

Open ip-address:8080/xmlui

Outstanding Issues

Currently, we use docker exec to configure administrative permissions and to ingest content within a DSpace instance.

With Fargate deployment, it is unclear how to connect to an ECS container and issue commands within the container.