STEPS FOR SETUP
- If docker is not installed, install it.
- Run docker-compose up --build in the root directory.
- Visit the app at localhost:8080!
=====FOR DEV=====
- docker-compose up --build
- docker-compose stop web
- cd web
- npm run server-dev
- npm run react-dev *TODO: fix environment variables
=====DEPLOYMENT INSTRUCTIONS=====
- Install the aws ecs cli https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.html
- Configure the aws ecs cli using your account details https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_Configuration.html
- Install the aws cli https://docs.aws.amazon.com/cli/latest/userguide/installing.html
- Configure the aws cli https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-quick-configuration
- Run aws iam --region us-east-1 create-role --role-name ecsExecutionRole --assume-role-policy-document file://execution-assume-role.json
- Run aws iam --region us-east-1 attach-role-policy --role-name ecsExecutionRole --policy-arn arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
- Run ecs-cli up
- Run aws ec2 create-security-group --group-name "my-sg" --description "My security group" --vpc-id "VPC_ID", using the vpc id from the previous command
- Run aws ec2 authorize-security-group-ingress --group-id "security_group_id" --protocol tcp --port 80 --cidr 0.0.0.0/0, using the security group id from the previous command
- Change the ports of the web service in the docker-compose.yml from 8089:8089 to 80:80
- Change the ecs-params.yml subnet IDs to the two subnets outputted by step 7, and the security group id to that of the output of step 8
- Run docker-compose up --build to build all images
- Run ecs-cli compose --file docker-compose.prod.yml --project-name magic-box service up --create-log-groups