-
Notifications
You must be signed in to change notification settings - Fork 1
Z_DEPRECATED Manually Deploying Test System with Docker and ECS
This page is deprecated, and is only kept for reference!
We use Docker Hub alongside AWS Elastic Container Service (ECS) for test system deployment.
This works by pushing the needed images (usually frontend & backend) to Docker Hub, and, using an ECS context in Docker, deploying directly to AWS ECS. The preconfigured docker-compose.yml
file at the project root will do most of the setup work for you, so you shouldn't have to manually set up containers or tasks through the AWS console.
VERY IMPORTANT: Make sure the COMPOSE_PROJECT_NAME
variable is set in the project root .env
file!
To manually deploy, follow the following steps:
- Create a Docker ECS context with the project's name, called
ecscontext
. The command for this is
docker context create ecs ecscontext
You will then be prompted for your AWS credentials. This step is mandatory, and your account must have the required permissions.
-
Ensure you have corresponding repositories set up on Docker Hub. The suggested naming is
[projectname]-frontend
, and[projectname-backend]
, respectively. The Docker compose action will automatically deploy the newest image that has been uploaded here. -
You will then need to build the containers you need (backend and/or frontend), and push them to Docker Hub. in the
scripts
folder, a script filedeployTest.sh
has been set up. Running this file will update both containers, and deploy all containers (including database) to AWS ECS.
NOTE: If you're adapting this file for a project branch, ensure the repository names have been set correctly! Also make sure the --project-name
parameter has been set correctly.
- After the deployment has completed, use the command
docker compose ps
to see what containers are running, and get their addresses/ports.
Note that when you initially deploy a project, you will not know the correct variables to provide to the VUE_APP_GRAPHQL_ENDPOINT
and VUE_APP_WS_ENDPOINT
variables. As it stands now, this needs to be done manually after the initial deployment; simply change those values to what you saw under docker compose ps
, and re-run the deployment script.
(Once we find a better solution to this, this section will be updated accordingly. It only needs to be done once per project.)