{"id":22591309,"url":"https://github.com/itzzjb/nginx-docker-container-in-aws","last_synced_at":"2026-05-06T08:31:39.673Z","repository":{"id":247708592,"uuid":"826205093","full_name":"itzzjb/nginx-docker-container-in-aws","owner":"itzzjb","description":"Running Nginx container and a Nodejs container in AWS ec2 instance","archived":false,"fork":false,"pushed_at":"2024-07-19T05:59:56.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T21:15:31.333Z","etag":null,"topics":["aws","docker","ec2-instances","nginx"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itzzjb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-07-09T09:11:02.000Z","updated_at":"2024-07-19T05:59:59.000Z","dependencies_parsed_at":"2024-07-19T11:35:54.175Z","dependency_job_id":null,"html_url":"https://github.com/itzzjb/nginx-docker-container-in-aws","commit_stats":null,"previous_names":["itzzjb/nginx-docker-container-in-aws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itzzjb/nginx-docker-container-in-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzzjb%2Fnginx-docker-container-in-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzzjb%2Fnginx-docker-container-in-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzzjb%2Fnginx-docker-container-in-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzzjb%2Fnginx-docker-container-in-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itzzjb","download_url":"https://codeload.github.com/itzzjb/nginx-docker-container-in-aws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzzjb%2Fnginx-docker-container-in-aws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32684598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","docker","ec2-instances","nginx"],"created_at":"2024-12-08T09:12:11.232Z","updated_at":"2026-05-06T08:31:39.653Z","avatar_url":"https://github.com/itzzjb.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e Remember to link (with a link or a network) both nginx container and nodejs container in order them to work. If you are using a docker-compose file of version 3 the links will be automatically created by the bridge network.\n\n# Creating a new image out of a container without a Dockerfile\n\n### Copying files between file nginx container and Desktop (Docker host)\n\nFirst we are getting a copy of\n\n```sh\ndocker cp nginxproxy:/etc/nginx/conf.d/default.conf ~/Desktop/default.conf\n```\n\nAfter doing the required changes we can can save the local file, and then replace the file inside the container with it\n\n```sh\ndocker cp ~/Desktop/default.conf nginxproxy:/etc/nginx/conf.d/\n```\n\nWe can validate and test nginx after the changes. (Testing to check whether the nginx command works inside the container)\n\n```sh\ndocker exec nginxproxy nginx -t\n```\n\nNow, to see the changes we are going to reload the nginx inside the nginx container.\n\n```sh\ndocker exec nginxproxy nginx -s reload\n```\n\n## Copying the docker-compose file into the AWS ec2 instance\n\nFirst we need to setup the ec2 instance by installing docker and docker-compose.\n[ Click here](https://tejaksha-k.medium.com/how-to-install-docker-and-docker-compose-to-ubuntu-20-04-azure-vm-and-aws-ec2-instances-72a498755c15)\n\nOpen the terminal from the folder where the pem file is, and copy the local file to the ec2 instance using a command similar to the below command.\n\n```sh\n scp -i \"docker.pem\" /Users/janudabethmin/Desktop/nginx-container-in-aws/docker-compose.yml  ubuntu@ec2-3-82-220-118.compute-1.amazonaws.com:/home/ubuntu/\n```\n\nNow we can use this file to run the container by pulling the images from docker hub registry.\n\n\u003e [!CAUTION]\n\u003e But because I have a M1 Mac, and the images built on my M1 Mac will not work on an AWS instance. I will have to build the images on the AWS instance in order to those images to support in a AWS ec2 instance. So, either I would need to upload all the files to the AWS instance using scp or clone a git repository from the AWS instance and run the docker compose file while building the images locally using the Dockerfiles.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzzjb%2Fnginx-docker-container-in-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzzjb%2Fnginx-docker-container-in-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzzjb%2Fnginx-docker-container-in-aws/lists"}