{"id":30124994,"url":"https://github.com/thekicker/docker-tutorial-example-proj","last_synced_at":"2026-02-11T04:03:59.431Z","repository":{"id":306834337,"uuid":"1027340387","full_name":"TheKicker/docker-tutorial-example-proj","owner":"TheKicker","description":"I needed an example project for a Docker tutorial, had ChatGPT come up with this shin dig. Lol it isn't 100% accurate but it works for what I need it to do.","archived":false,"fork":false,"pushed_at":"2025-07-27T21:39:48.000Z","size":845,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-10T15:57:18.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://thekicker.github.io/docker-tutorial-example-proj/","language":"HTML","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/TheKicker.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-07-27T20:22:40.000Z","updated_at":"2025-07-30T23:49:37.000Z","dependencies_parsed_at":"2025-07-27T23:25:35.015Z","dependency_job_id":"41bf5199-3514-4754-a64c-a3758336db68","html_url":"https://github.com/TheKicker/docker-tutorial-example-proj","commit_stats":null,"previous_names":["thekicker/docker-tutorial-example-proj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheKicker/docker-tutorial-example-proj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheKicker%2Fdocker-tutorial-example-proj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheKicker%2Fdocker-tutorial-example-proj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheKicker%2Fdocker-tutorial-example-proj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheKicker%2Fdocker-tutorial-example-proj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheKicker","download_url":"https://codeload.github.com/TheKicker/docker-tutorial-example-proj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheKicker%2Fdocker-tutorial-example-proj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29326873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"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-08-10T15:35:35.283Z","updated_at":"2026-02-11T04:03:59.415Z","avatar_url":"https://github.com/TheKicker.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐳 Docker Tutorial Example Project\n\nWelcome! This guide walks you through how to run a Node.js app inside a Docker container, step-by-step, even if you're brand new to Docker.\n\n🎯 **Example project:** [https://github.com/TheKicker/docker-tutorial-example-proj](https://github.com/TheKicker/docker-tutorial-example-proj)\n\n---\n\n## 🐳 What is Docker?\n\n**Docker** is a tool that lets you package up your code and everything it needs to run — like Node.js, dependencies, and system settings — into a container.\n\nThink of a **container** like a self-contained box: it’ll run the same way on your computer, a friend’s laptop, or a cloud server. No more “it works on my machine” excuses.\n\n---\n\n## ⚖️ Docker vs Virtual Machines\n\n| Feature            | Docker                            | Virtual Machine (VM)                 |\n| ------------------ | --------------------------------- | ------------------------------------ |\n| **Speed**          | Starts in seconds                 | Takes minutes                        |\n| **Size**           | Lightweight (MBs)                 | Heavy (GBs)                          |\n| **Resources Used** | Shares your OS kernel             | Needs full OS per VM                 |\n| **Isolation**      | App-level isolation               | Full system isolation                |\n| **Best For**       | Developers and apps in containers | Running different OSs or full setups |\n\n💡 **TL;DR:** Docker is faster, lighter, and more developer-friendly than VMs.\n\n---\n\n## 🖥️ How to Install Docker (on Windows)\n\n1. Go to [https://www.docker.com/](https://www.docker.com/)\n2. Click **\"Get Docker\"** and download **Docker Desktop for Windows (AMD64)**.\n3. Run the installer and follow the steps.\n4. After install, restart your computer if needed.\n5. Open **Docker Desktop** and make sure it’s running.\n\n📌 You’ll also want to have **WSL 2** installed — the Docker installer should guide you through it.\n\n---\n\n## 📦 What is a Dockerfile?\n\nA **Dockerfile** is a text file with instructions that tell Docker how to build your app into a container.\n\nHere’s a simple example for a Node.js app:\n\n```Dockerfile\n# Uses the official Node.js 14 image\nFROM node:14\n\n# Set working directory\nWORKDIR /app\n\n# Copy dependencies (includes package and package-lock files)\nCOPY package*.json .\n\n# Install dependencies for production\nRUN npm install --production\n\n# Copy all project files\nCOPY . .\n\n# Expose port 3000\nEXPOSE 3000\n\n# Start the app\nCMD [\"npm\", \"start\"]\n````\n\n🔍 **What it does:**\n\n* Pulls a Node 14 environment\n* Copies your code\n* Installs `npm` dependencies\n* Starts the app on port 3000\n\n---\n\n## 🚀 How to Run Your Project\n\nAfter installing Docker, open a terminal like PowerShell, then:\n\n### 1. Clone your project\n\n```bash\ngit clone https://github.com/TheKicker/docker-tutorial-example-proj.git\ncd docker-tutorial-example-proj\n```\n\n---\n\n### 🛠️ Step 2: Build the Docker Image\n\n```bash\ndocker build -t my-node-app .\n```\n\nLet’s break that down:\n\n| Part             | What it means                                                                                                                                                              |\n| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `docker build`   | Tells Docker: “Let’s build a container image.”                                                                                                                             |\n| `-t my-node-app` | The `-t` stands for **tag**, which is basically a **name** or **nickname** for your image. So instead of using a long ID to run it later, you can just type `my-node-app`. |\n| `.` (the dot)    | This says: “Use the Dockerfile in **this folder**.”                                                                                                                        |\n\n🔍 **Why this matters:**\nWithout the `-t` flag, Docker builds your image but doesn’t give it a name — which means you’d have to refer to it by a long weird SHA ID later. With `-t my-node-app`, you're basically saying:\n\n\u003e “Hey Docker, when you’re done building this thing, call it `my-node-app` so I can easily run it later.”\n\n---\n\n### 3. Run the app\n\n```bash\ndocker run -p 3000:3000 my-node-app\n```\n\nThen open your browser and go to:\n\n```\nhttp://localhost:3000\n```\n\n---\n\n### 🔍 But wait... what does `-p 3000:3000` mean?\n\nWhen your app is running **inside the container**, it’s living in its own little world — like a mini-computer inside your computer. Just because it’s running doesn’t mean your main computer can talk to it yet.\n\n🧱 Here's the issue:\n\n* Inside the container, your Node app is listening on **port 3000**.\n* But your **actual computer** (the host) doesn't automatically know about that.\n\n🏡 The `-p` flag says:\n\n\u003e “Hey Docker, please open a door between my computer and the container.”\n\nSpecifically, `-p 3000:3000` means:\n\n\u003e \"Take port **3000** inside the container, and connect it to port **3000** on **my computer**.\"\n\nSo now when you visit:\n\n```\nhttp://localhost:3000\n```\n\nYour browser is talking to your **computer’s port 3000**, which is directly connected to the **container’s port 3000**. Magic! ✨\n\n🛑 If you forget the `-p` flag, the app still runs inside the container — but you won’t be able to access it from your browser.\n\n---\n\n## 🧠 Common Docker `run` Flags\n\n| Flag           | What it does                                |\n| -------------- | ------------------------------------------- |\n| `-p 3000:3000` | Maps port 3000 in the container to your PC  |\n| `-d`           | Runs the container in the background        |\n| `--name`       | Lets you give the container a name          |\n| `-v`           | Mounts a folder as a volume (for live code) |\n\nExample with more flags:\n\n```bash\ndocker run -d -p 3000:3000 --name dev-app my-node-app\n```\n\n---\n\n## 🧹 Useful Commands \n\nWhen you’re done, you can clean up your containers and images:\n\n```bash\ndocker ps            # See running containers on your machine\ndocker stop \u003cID\u003e     # Stop a running container\ndocker rm \u003cID\u003e       # Remove a stopped container\ndocker image prune   # Remove unused images (be careful)\n```\n\n---\n\u003cbr\u003e\nHappy Dockering! 🐳✨","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekicker%2Fdocker-tutorial-example-proj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekicker%2Fdocker-tutorial-example-proj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekicker%2Fdocker-tutorial-example-proj/lists"}