- Client: create-react-app, redux, bootstrap, react-router
- Server: pg, express
- Db: postgres 10.3
- First time running? Run
docker-compose up --build
- Otherwise, run
docker-compose up
- To clean up old resources:
docker system prune
- To run all services:
docker-compose up
- To re-build all containers and run:
docker-compose up --build
- If packages aren't installing, make sure you're in the service's directory!
- If docker freaks out about network errors, make sure you aren't running any other
docker containers on your computer. If it's still freaking out after shutting
those off, run
docker system prune
. - The client is proxying any non-html requests to server.
- 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 --cluster (cluster)
- 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.prod.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
- Create an elastic container repository- https://console.aws.amazon.com/ecs/home?region=us-east-1#/repositories
- Follow the instructions of "view push commands" to set up the ability to push docker images
- Push all of your images up with tags of their names
- Create a docker-compose.prod.yml with image URLs and changed ports
- Run ecs-cli compose --cluster (cluster) --file docker-compose.prod.yml --project-name magic-box service up --create-log-groups