{"id":28148000,"url":"https://github.com/developerwaleed/node-docker-app","last_synced_at":"2026-01-28T19:35:59.196Z","repository":{"id":288254377,"uuid":"967346837","full_name":"developerwaleed/node-docker-app","owner":"developerwaleed","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-17T07:01:48.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T18:23:45.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/developerwaleed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2025-04-16T10:09:57.000Z","updated_at":"2025-04-17T07:01:52.000Z","dependencies_parsed_at":"2025-04-16T14:34:33.348Z","dependency_job_id":"3280cc97-5d49-4d93-b82f-14b8884c08cf","html_url":"https://github.com/developerwaleed/node-docker-app","commit_stats":null,"previous_names":["developerwaleed/node-docker-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/developerwaleed/node-docker-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerwaleed%2Fnode-docker-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerwaleed%2Fnode-docker-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerwaleed%2Fnode-docker-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerwaleed%2Fnode-docker-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developerwaleed","download_url":"https://codeload.github.com/developerwaleed/node-docker-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerwaleed%2Fnode-docker-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28850391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: 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":[],"created_at":"2025-05-15T00:23:10.319Z","updated_at":"2026-01-28T19:35:59.185Z","avatar_url":"https://github.com/developerwaleed.png","language":"Dockerfile","readme":"# Node.js Docker Hello World\n\nA simple Node.js application containerized with Docker that displays \"Hello World\" when accessed.\n\n## Prerequisites\n\n- Docker installed on your machine\n- Node.js and npm (for local development)\n- AWS EC2 instance (for public access)\n\n## Building the Docker Image\n\n```bash\ndocker build -t node-hello-world .\n```\n\n## Running the Container\n\n```bash\ndocker run -p 3000:3000 node-hello-world\n```\n\n## Accessing the Application\n\n### Local Access\nOnce the container is running, you can access the application at:\n- http://localhost:3000\n\n### Public Access (EC2 Instance)\n\n1. **Fix Docker Permission Issues (if needed)**\n```bash\n# Add your user to the docker group\nsudo usermod -aG docker $USER\n\n# Apply the new group membership\nnewgrp docker\n```\n\n2. **Clone and Setup the Application**\n```bash\n# Clone the repository\ngit clone \u003cyour-repository-url\u003e\ncd node-docker-app\n\n# Build the Docker image\ndocker build -t node-hello-world .\n\n# Run the container in detached mode\ndocker run -d -p 3000:3000 node-hello-world\n```\n\n3. **Verify Local Access**\n```bash\n# Check if the application is running locally\ncurl localhost:3000\n```\n\n4. **Configure EC2 Security Group**\n- Go to AWS Management Console \u003e EC2 \u003e Security Groups\n- Select your instance's security group\n- Add inbound rule:\n  - Type: Custom TCP\n  - Port range: 3000\n  - Source: 0.0.0.0/0\n  - Description: Node.js app access\n\n5. **Access the Application**\n- Get your EC2 instance's public IP from AWS console\n- Access the application at: `http://\u003cyour-ec2-public-ip\u003e:3000`\n\n### Troubleshooting\n\n1. **Check Running Containers**\n```bash\n# List running containers\ndocker ps\n\n# Check port listening status\nsudo netstat -tulpn | grep 3000\n```\n\n2. **Restart Container**\n```bash\n# Stop all running containers\ndocker stop $(docker ps -q)\n\n# Run container with explicit port mapping\ndocker run -d -p 0.0.0.0:3000:3000 node-hello-world\n```\n\n3. **Check Firewall Status**\n```bash\nsudo ufw status\n```\n\nsetup EC2:\n\nSure! Here's a consolidated list of all the commands you need to run to install Docker, Git, and Node.js on your EC2 instance.\n\n### **Step-by-Step Commands**\n\n1. **Update package list:**\n   ```bash\n   sudo apt-get update\n   ```\n\n---\n\n### **Install Docker**\n\n2. **Install Docker dependencies:**\n   ```bash\n   sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y\n   ```\n\n3. **Add Docker's official GPG key:**\n   ```bash\n   curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n   ```\n\n4. **Add Docker repository:**\n   ```bash\n   sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\"\n   ```\n\n5. **Update the package list again:**\n   ```bash\n   sudo apt-get update\n   ```\n\n6. **Install Docker:**\n   ```bash\n   sudo apt-get install docker-ce -y\n   ```\n\n7. **Start Docker and enable it to run on boot:**\n   ```bash\n   sudo systemctl start docker\n   sudo systemctl enable docker\n   ```\n\n8. **Verify Docker installation:**\n   ```bash\n   sudo docker --version\n   ```\n\n9. **(Optional) Add your user to the Docker group:**\n   ```bash\n   sudo usermod -aG docker $USER\n   ```\n\n---\n\n### **Install Git**\n\n10. **Install Git:**\n    ```bash\n    sudo apt-get install git -y\n    ```\n\n11. **Verify Git installation:**\n    ```bash\n    git --version\n    ```\n\n---\n\n### **Install Node.js**\n\n12. **Install Node.js from NodeSource repository:**\n    ```bash\n    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -\n    ```\n\n13. **Install Node.js and npm:**\n    ```bash\n    sudo apt-get install -y nodejs\n    ```\n\n14. **Verify Node.js and npm installation:**\n    ```bash\n    node --version\n    npm --version\n    ```\n\n---\n\n## Continuous Deployment\n\nThis project uses GitHub Actions for continuous deployment to EC2. When changes are pushed to the main branch, the following automated process occurs:\n\n1. GitHub Actions connects to your EC2 instance at `ec2-51-20-81-225.eu-north-1.compute.amazonaws.com`\n2. Pulls the latest code from the repository\n3. Rebuilds and restarts the Docker container\n\n### Required Secrets\n\nYou need to add your EC2 .pem key as a secret in your GitHub repository:\n\n1. Go to your GitHub repository\n2. Click on \"Settings\"\n3.  Click on \"Secrets and variables\" → \"Actions\"\n4. Click \"New repository secret\"\n5. Name: `EC2_PEM_KEY`\n6. Value: Copy the entire contents of your `test_instance.pem` file\n\n### Manual Deployment\n\nIf you need to manually deploy the application, use these commands:\n\n```bash\n# SSH into your EC2 instance\nssh -i \"test_instance.pem\" ubuntu@ec2-51-20-81-225.eu-north-1.compute.amazonaws.com\n\n# Once connected, run these commands\ncd ~/test_app/node-docker-app\ngit pull\ndocker build -t node-hello-world .\ndocker stop node-app || true\ndocker rm node-app || true\ndocker run -d --name node-app -p 3000:3000 node-hello-world\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperwaleed%2Fnode-docker-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperwaleed%2Fnode-docker-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperwaleed%2Fnode-docker-app/lists"}