Note: As mentioned earlier, you can use images from either ECR or Dockerhub in this section.
Still within the ECS Console interface:
Enter the following information for the task definition:
fcjresbar-task-be
Next information:
In the container definition section, fill in the following details:
backend
5000
; protocol: TCP; App protocol: HTTP2
4
3
When configuring containers in AWS Fargate, you don’t need to worry about the host port, as the host port will default to the container’s port.
Next, add environment variables, which are important. Without this configuration, the NodeJS server inside won’t run. These include:
MYSQL_USER
= admin
MYSQL_PASSWORD
= letmein12345
MYSQL_DATABASE
= fcjresbar
DB_HOST
= “your rds endpoint”DB_DIALECT
= mysql
PORT
= 5000
JWT_SECRET
= 0bac010eca699c25c8f62ba86e319c2305beb94641b859c32518cb854addb5f4
Keep the default configurations.
Finally, click Create to create the task definition.