{"id":16989531,"url":"https://github.com/jottenlips/rust-rocket-ecs","last_synced_at":"2025-06-12T02:04:13.358Z","repository":{"id":101733658,"uuid":"565283945","full_name":"jottenlips/rust-rocket-ecs","owner":"jottenlips","description":"🦀 Rust server running in a Docker container deployed to AWS ECS via Terraform 🚀","archived":false,"fork":false,"pushed_at":"2024-12-31T19:26:22.000Z","size":38,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T04:09:44.801Z","etag":null,"topics":["aws","containers","docker","docker-compose","ecr","ecs","fargate","internet-gateway","load-balancer","nat-gateway","netwoorking","rocket","rust","rust-lang","rust-server","terraform","vpc"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jottenlips.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jottenlips"}},"created_at":"2022-11-12T22:39:11.000Z","updated_at":"2024-12-31T19:26:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7ce6dd9-c4a5-4073-83d7-baabd30309e1","html_url":"https://github.com/jottenlips/rust-rocket-ecs","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Frust-rocket-ecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Frust-rocket-ecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Frust-rocket-ecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2Frust-rocket-ecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jottenlips","download_url":"https://codeload.github.com/jottenlips/rust-rocket-ecs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514221,"owners_count":21116903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","containers","docker","docker-compose","ecr","ecs","fargate","internet-gateway","load-balancer","nat-gateway","netwoorking","rocket","rust","rust-lang","rust-server","terraform","vpc"],"created_at":"2024-10-14T03:06:58.742Z","updated_at":"2025-04-12T04:09:49.616Z","avatar_url":"https://github.com/jottenlips.png","language":"HCL","funding_links":["https://github.com/sponsors/jottenlips"],"categories":[],"sub_categories":[],"readme":"Honestly overkill for a hello world app. Think of it as hello world for ECS 👋\n\n# Local\n\n1. Install Docker, Start Docker app\n\n2. `docker-compose up`\n\n3. open http://localhost:8000/\n\n# Deploy\n\n\u003e - You need an AWS account for this\n\n1. Setup [Terraform State](https://github.com/jottenlips/terraform-state-s3-backend-example)\n\n2. Spin up infrastructure\n\n\u003e - Spins up VPC, NAT, IGW, security groups, ECS, ALB, and ECR to push your docker image to.\n\n```\nterraform init\nterraform plan\nterraform apply\n```\n\nThis should output a url like\n\n```\n# This URL is no longer running since I didn't want to keep paying for it\nalb_url = \"http://rocket-app-lb-105361214.us-east-1.elb.amazonaws.com\"\n```\n\nSave it for later.\n\n3. Push your Docker image to ECR\n\nGo to this URL, view push commands\n\n\u003e - Note: replace account id\n\nhttps://us-east-1.console.aws.amazon.com/ecr/repositories/private/accountid/rocket-ecr-repo?region=us-east-1\n\n```\naws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin accountid.dkr.ecr.us-east-1.amazonaws.com\n```\n\n```\ndocker build -t rocket-ecr-repo .\n```\n\n```\ndocker tag rocket-ecr-repo:latest accountid.dkr.ecr.us-east-1.amazonaws.com/rocket-ecr-repo:latest\n```\n\n```\ndocker push accountid.dkr.ecr.us-east-1.amazonaws.com/rocket-ecr-repo:latest\n```\n\nOnce the docker image is up and the ECR tasks are done deploying you can open up your Rocket app\n\n```\nalb_url = \"http://rocket-app-lb-105361214.us-east-1.elb.amazonaws.com\"\n```\n\n# Destroy\n\nDelete the latest image in ECR\n\n```\nterraform destroy\n```\n\n### Benefits of ECS / Docker / Terraform\n\nWith these technologies we can deploy apps written in any language and can scale horizontally and vertically. Say you had a Flask app also running in a docker container, you could use this terraform config to get it deployed to ECS quickly and scale the memory/cpu to what you need as well as the number of desired instances. You could also add an autoscaling group if you desire.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjottenlips%2Frust-rocket-ecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjottenlips%2Frust-rocket-ecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjottenlips%2Frust-rocket-ecs/lists"}