{"id":25400570,"url":"https://github.com/yadavvishal/dockerfiles","last_synced_at":"2026-04-30T09:35:53.758Z","repository":{"id":276298100,"uuid":"928851831","full_name":"yadavvishal/DockerFiles","owner":"yadavvishal","description":"This project runs a simple Node.js application inside a Docker container.","archived":false,"fork":false,"pushed_at":"2025-02-13T22:58:32.000Z","size":713,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T00:49:10.686Z","etag":null,"topics":["docker-image","dockerfile"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/yadavvishal.png","metadata":{"files":{"readme":"README (1).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}},"created_at":"2025-02-07T11:00:09.000Z","updated_at":"2025-02-13T22:58:35.000Z","dependencies_parsed_at":"2025-02-07T12:34:11.360Z","dependency_job_id":null,"html_url":"https://github.com/yadavvishal/DockerFiles","commit_stats":null,"previous_names":["yadavvishal/dockerfiles"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadavvishal%2FDockerFiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadavvishal%2FDockerFiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadavvishal%2FDockerFiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadavvishal%2FDockerFiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yadavvishal","download_url":"https://codeload.github.com/yadavvishal/DockerFiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501913,"owners_count":21114681,"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":["docker-image","dockerfile"],"created_at":"2025-02-16T00:18:26.744Z","updated_at":"2026-04-30T09:35:53.721Z","avatar_url":"https://github.com/yadavvishal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Node.js Application in a Docker Container\n\nThis project runs a simple Node.js application inside a Docker container.\n\n## Prerequisites\n- Docker installed on your system\n- Node.js (for local testing, optional)\n\n## Project Structure\n```\n.\n├── Dockerfile\n├── main.js\n├── package.json\n├── package-lock.json\n```\n\n## Setup and Usage\n\n### 1. Build the Docker Image\nRun the following command to build the Docker image:\n```sh\ndocker build -t my-node-app .\n```\n\n### 2. Run the Container\nTo run the application inside a container, use:\n```sh\ndocker run -p 8000:8000 my-node-app\n```\nThis binds the container's port `8000` to the host machine's port `8000`.\n\n### 3. Access the Application\nOnce the container is running, open your browser and visit:\n```\nhttp://localhost:8000\n```\nYou should see the following response:\n```json\n{\n  \"message\": \"Hey, I am nodejs in container\"\n}\n```\n\n## Dockerfile Explanation\n- Uses `ubuntu` as the base image.\n- Updates system packages and installs `curl`.\n- Sets up Node.js version 18.\n- Copies `package.json`, `package-lock.json`, and `main.js` into the container.\n- Installs dependencies using `npm install`.\n- Runs `main.js` as the application entry point.\n\n## Stopping the Container\nTo stop the running container, press `CTRL + C` in the terminal or find and stop the container using:\n```sh\ndocker ps\n```\nFind the container ID and stop it using:\n```sh\ndocker stop \u003ccontainer_id\u003e\n```\n\n## Cleanup\nTo remove the container and image:\n```sh\ndocker rm \u003ccontainer_id\u003e\ndocker rmi my-node-app\n```\n\n## License\nThis project is open-source and available for modification and distribution.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyadavvishal%2Fdockerfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyadavvishal%2Fdockerfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyadavvishal%2Fdockerfiles/lists"}