Containerize a Node.js App with Docker
Package a Node.js app into a Docker container and automate delivery with GitHub Actions.
Introduction
30 Second Summary
Every app you use on your phone or computer was packaged up and shipped from a developer's machine to a server somewhere. Modern teams use containers to make that packaging consistent and repeatable, no matter where the app ends up running.
In this project, you will build a Node.js web server, package it inside a Docker container, and set up a GitHub Actions pipeline that automatically publishes your container image every time you push code.
What You'll Build
A simple Node.js web server packaged inside a Docker container, with a fully automated CI/CD pipeline that builds and publishes the container image to GitHub Container Registry.
By the end of this project, you'll have:
- A working Docker container running a Node.js web server on your local machine.
- A GitHub Actions workflow that automatically builds and pushes your container image on every push.
- A published container image visible on your GitHub profile at ghcr.io.
- Secret Mission: Add environment variable configuration and a .dockerignore to optimize your container like a pro.
Are there any prerequisites?
You'll need a GitHub account, Node.js installed on your machine, and basic familiarity with GitHub Actions workflow files. No prior Docker experience is required.
Install Docker Desktop
Containers package an application with everything it needs to run, so it works the same way on any machine. Docker is the most popular tool for building and running containers.
In this step, you'll install Docker Desktop on your machine. Docker Desktop provides the engine that builds container images and runs containers locally.
In this step, get ready to:
- Install Docker Desktop on your machine.
- Start Docker Desktop and confirm it's running.
- Verify Docker can pull and run container images.
Download and install Docker Desktop
Docker Desktop is a desktop application that includes the Docker engine, CLI tools, and a graphical dashboard for managing containers. Let's check if you already have it installed.
- Press the Windows key to open your search bar.
- Type PowerShell and press Enter to open it.
- Check if Docker is already installed by running this command:
docker --version
✔️ I see a version number
Docker is already installed on your machine. Skip ahead to the "Verify Docker can run containers" substep below.
ⓧ Command not found
Docker isn't installed yet. Follow these steps to get it set up.
- Open your browser and go to the Docker Desktop for Windows download page:
- https://docs.docker.com/desktop/setup/install/windows-install/
- Click the download button to get the installer.
- Run the downloaded installer.
- When prompted, choose the per-user installation option (recommended, no admin required).
- Follow the installer prompts to complete the installation.
What happens during installation?
The installer will enable WSL 2 (Windows Subsystem for Linux) if it is not already enabled on your machine. WSL 2 is what Docker uses to run Linux containers on Windows.
A system restart may be required after installation. If prompted, save your work, restart, and come back to this step.
Installation not starting?
Make sure your system meets the requirements: Windows 10 64-bit version 22H2 (build 19045) or Windows 11 64-bit version 23H2 (build 22631) or higher, with at least 8GB RAM.
help me troubleshoot my Docker Desktop installation on Windows
Start Docker Desktop
After installation completes (or after restarting your machine), you need to start Docker Desktop before you can use Docker commands.
- Press the Windows key to open your search bar.
- Type Docker Desktop and press Enter to open it.
- Wait for Docker Desktop to finish starting. The whale icon in the system tray will stop animating once it's ready.
What is Docker Desktop doing?
Docker Desktop starts the Docker engine in the background using WSL 2. This engine is what actually builds images and runs containers.
You'll also see a graphical dashboard where you can view running containers, images, and volumes. For this project, you'll use the terminal instead.
Docker Desktop stuck on starting?
If the whale icon keeps animating for more than a few minutes, try restarting Docker Desktop by right-clicking the whale icon in the system tray and selecting Restart.
help me fix Docker Desktop that is stuck on starting
Verify Docker can run containers
Now that Docker Desktop is running, let's confirm the Docker CLI works and can pull images from the internet.
- In your PowerShell terminal, confirm Docker is available by running this command:
docker --version
You should see a version number printed, confirming the Docker CLI is working.
- Verify Docker can pull and run images by running this command:
docker run hello-world
What does this command do?
The docker run hello-world command downloads a tiny test image from Docker Hub and runs it as a container. The container prints a confirmation message and then exits.
This proves three things at once: Docker can connect to the internet, pull images from a registry, and run containers successfully.
You should see output that includes the message "Hello from Docker!" confirming everything is working.
Seeing 'command not found' or connection errors?
If docker is not recognized, make sure Docker Desktop is fully started (whale icon in the system tray should be still, not animating).
If you see a network error, check that your internet connection is active and no firewall is blocking Docker.
help me fix Docker not being recognized in my terminal after installing Docker Desktop on Windows
Docker is installed, running, and ready to build containers. Next up, you'll create the Node.js application that you'll package inside a Docker container.
Create the Node.js App
Docker is installed and ready to containerize code. Now you need an application to put inside a container.
In this step, you'll create a simple Node.js web server that responds with JSON data. This is the app that Docker will package up in the next step.
In this step, get ready to:
- Create a project folder and package.json file.
- Write a Node.js web server in server.js.
- Test the app locally in your browser.
Create the project folder and files
- Move to your Desktop by running this command:
cd ~/Desktop
- Create your project folder and move into it by running these commands:
mkdir docker-node-app
cd docker-node-app
- Confirm you're inside the new folder by running:
pwd
You should see a path ending in docker-node-app.
Don't see docker-node-app?
Make sure you typed mkdir docker-node-app exactly as shown. Folder names are case-sensitive on some systems.
If you see a 'file already exists' error, the folder was already created. Just run cd docker-node-app to move into it.
Help me troubleshoot my project folder setup.
- Open VS Code by pressing Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
- Type Visual Studio Code and press Enter to open it.
- In VS Code, click File in the top menu bar.
- Click Open Folder.
- Navigate to your Desktop, select the docker-node-app folder, and click Open.
You should see docker-node-app in the Explorer sidebar on the left. The folder is empty for now.
- In the Explorer sidebar, hover over the folder name and click the New File... icon (it looks like a page with a plus sign).
- Type package.json and press Enter.
- Paste the following code into the file:
{
"name": "docker-node-app",
"version": "1.0.0",
"description": "A simple Node.js app containerized with Docker",
"main": "server.js",
"scripts": {
"start": "node server.js"
}
}
What does this file do?
- package.json is the identity card for any Node.js project. It tells Node.js (and Docker, later) what the project is called and how to run it.
- The "start": "node server.js" script defines the command that launches your app.
- Save package.json by pressing Cmd+S (macOS) or Ctrl+S (Windows).
✔️ Awesome, I've got everything!
Great. Make sure the file is saved (no dot on the tab name) before moving on.
ⓧ I'd like to double check the full code
Here is the complete package.json file:
{
"name": "docker-node-app",
"version": "1.0.0",
"description": "A simple Node.js app containerized with Docker",
"main": "server.js",
"scripts": {
"start": "node server.js"
}
}
- Create another new file by clicking the New File... icon in the Explorer sidebar again.
- Type server.js and press Enter.
- Paste the following code into the file:
const http = require("http");
const PORT = 3000;
const server = http.createServer((req, res) => {
// Set the response header to JSON format
res.writeHead(200, { "Content-Type": "application/json" });
// Send a JSON response with a message and status
res.end(JSON.stringify({ message: "Hello from Docker!", status: "running" }));
});
// Start the server and listen on the specified port
server.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
What does this code do?
- http.createServer creates a web server using Node.js's built-in HTTP module. No external packages needed.
- When someone visits the server, it responds with a JSON object containing a message and a status.
- server.listen(PORT) tells the server to start accepting connections on port 3000.
- Save server.js by pressing Cmd+S (macOS) or Ctrl+S (Windows).
- Confirm both files appear in the Explorer sidebar. You should see package.json and server.js listed under docker-node-app.
Don't see both files?
Make sure you created both files inside the docker-node-app folder, not outside it. If a file ended up in the wrong place, right-click it in the Explorer and select Delete, then create it again.
Help me find my project files in VS Code.
✔️ Awesome, I've got everything!
Great. Make sure both files are saved before moving on.
ⓧ I'd like to double check the full code
Here is the complete server.js file:
const http = require("http");
const PORT = 3000;
const server = http.createServer((req, res) => {
res.writeHead(200, { "Content-Type": "application/json" });
res.end(JSON.stringify({ message: "Hello from Docker!", status: "running" }));
});
server.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
Test the app locally
Before containerizing the app with Docker, you should confirm it works on its own. Running it locally first makes troubleshooting easier if something goes wrong later.
- Open the integrated terminal in VS Code by pressing Ctrl+` (that's the backtick key, above Tab on most keyboards).
- Start the server by running this command:
node server.js
You should see Server running on port 3000 printed in the terminal.
- Open your web browser and navigate to http://localhost:3000.
You should see the JSON response displayed in the browser:
{"message":"Hello from Docker!","status":"running"}
- Return to VS Code and stop the server by pressing Ctrl+C in the terminal.
Not seeing the JSON response?
Make sure the terminal still shows Server running on port 3000 without any error messages. If you see a syntax error, double-check your server.js matches the code above exactly.
If the browser shows 'This site can't be reached', confirm you typed http://localhost:3000 (not https). Also check that the terminal is still running the server (you haven't pressed Ctrl+C yet).
Help me debug why my Node.js server isn't responding.
Your app is working locally. Next up, you'll write a Dockerfile to package this server into a container image that can run anywhere.
Write the Dockerfile and Build the Image
Your Node.js app is tested and working. Now it's time to solve the biggest problem in software: "it works on my machine."
A Dockerfile is a recipe that tells Docker exactly how to package your app into a container image. In this step, you'll write that recipe and build your first image.
In this step, get ready to:
- Create a Dockerfile that defines how to package the app.
- Build a Docker image from the Dockerfile.
Create the Dockerfile
The Dockerfile tells Docker what base image to start from, where to put your code, and how to run it.
- In VS Code, right-click inside the docker-node-app folder in the Explorer sidebar.
- Click New File.
- Type Dockerfile and press Enter. Make sure there is no file extension.
- Add the following code to Dockerfile:
# Use a lightweight Linux image with Node.js pre-installed
FROM node:24-alpine
# Set the working directory inside the container
WORKDIR /app
# Copy all project files into the container
COPY . .
# Document which port the app listens on
EXPOSE 3000
# Define the command to start the app
CMD ["node", "server.js"]
What does this Dockerfile do?
- FROM node:24-alpine starts from a lightweight Linux image (~50 MB) with Node.js already installed. The alpine variant keeps the image small.
- WORKDIR /app creates a /app directory inside the container and switches into it.
- COPY . . copies all your project files from your machine into the container's /app directory.
- EXPOSE 3000 documents that the app listens on port 3000. It doesn't actually open the port. That happens when you run the container.
- CMD ["node", "server.js"] tells Docker what command to run when the container starts.
- Save Dockerfile.
- Confirm the file exists by running this in your terminal:
ls
You should see Dockerfile, package.json, and server.js in the output.
Don't see the Dockerfile?
- Make sure the filename is exactly Dockerfile with a capital D and no file extension. Some editors add .txt automatically.
- Check that the file is inside your docker-node-app folder, not in a subfolder.
- help me troubleshoot why my Dockerfile isn't showing up in my project folder
✔️ Awesome, I've got everything!
Great. Make sure you've saved your file before moving on.
ⓧ I'd like to double check the full code
Here's the complete Dockerfile:
FROM node:24-alpine
WORKDIR /app
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
Build the Docker image
Now that you have a recipe, you can use it to create an image. The image is a snapshot of your app and everything it needs to run.
- Build the Docker image by running this command from your docker-node-app folder:
docker build -t docker-node-app .
Docker will pull the node:24-alpine base image and create layers for each instruction in your Dockerfile. You'll see progress messages scroll by in the terminal.
What does this command do?
- docker build tells Docker to create a new image from a Dockerfile.
- -t docker-node-app gives the image a name (tag) so you can reference it later.
- . tells Docker to use the current directory as the build context. This is where Docker looks for the Dockerfile and the files to copy.
- Confirm the image was created by running:
docker images
You should see docker-node-app listed with the tag latest.
Build failed?
- Make sure Docker Desktop is running. Check for the whale icon in your system tray.
- Verify you're running the command from inside the docker-node-app folder where the Dockerfile is located.
- Check for typos in the Dockerfile. A mistyped instruction like FORM instead of FROM will cause the build to fail.
- help me debug why my Docker build is failing
You now have a packaged image of your app ready to run anywhere Docker runs. Next up, you'll start a container from this image and see your app respond from inside it.
Run and Test the Container
Your Docker image is built and sitting on your machine. Now it's time to bring it to life by running it as a container.
Running a container launches your image as a live, isolated process. You'll map the container's internal port to your machine so you can access the app in your browser, just like you did when testing with node server.js directly.
In this step, get ready to:
- Run the Docker container in the background with port mapping.
- Confirm the containerized app responds in your browser.
- Stop the container using Docker CLI commands.
Start the container with port mapping
Your image contains the app, but it needs to be launched as a running process. The docker run command creates a container from your image and starts it.
- Start your container in the background by running this command:
docker run -d -p 3000:3000 docker-node-app
What does this command do?
- -d runs the container in detached mode (in the background). Docker starts the container and returns you to the terminal prompt instead of locking up your terminal window.
- -p 3000:3000 creates a port mapping between your machine (host) and the container. The format is HOST:CONTAINER. Without this, you would not be able to reach the app from your browser.
- docker-node-app is the name of the image you built in the previous step.
You should see a long string of characters printed in your terminal. This is your container ID.
Seeing an error about port 3000?
If you get a message about port 3000 already being in use, you may still have the Node.js server running from the previous step. Make sure you stopped it with Ctrl+C before running the Docker container.
Help me fix this port conflict
Confirm the app is responding from inside the container
The container is running in the background. Let's confirm it is actually serving your app.
- Open your browser and navigate to http://localhost:3000.
You should see the JSON response: {"message":"Hello from Docker!","status":"running"}. This response is coming from your app running inside the Docker container.
- Check the running container by running this command:
docker ps
What does docker ps show?
The docker ps command lists all running containers. You'll see columns for CONTAINER ID, IMAGE, COMMAND, CREATED, STATUS, PORTS, and NAMES.
Look for your docker-node-app image in the list. The PORTS column should show 0.0.0.0:3000->3000/tcp, confirming the port mapping is active.
Don't see the JSON response in your browser?
Run docker ps to check if the container is actually running. If it is not listed, the container may have exited immediately. Run docker ps -a to see all containers including stopped ones, and check the STATUS column for clues.
Help me debug why my container exited
Stop the container
Now that you've confirmed the app works inside the container, you can stop it. Stopping a container halts the process inside but does not remove the container itself.
- Find your container ID by looking at the CONTAINER ID column in the docker ps output from earlier. You only need the first few characters.
- Stop the container by running this command:
docker stop [[CONTAINER_ID="your container ID from docker ps"]]
- Verify the container has stopped by running:
docker ps
Your container should no longer appear in the list. The docker ps command only shows running containers by default.
What is the difference between stopping and removing?
When you stop a container, the process inside it halts but the container still exists on your system. You could restart it later with docker start.
Removing a container (docker rm) deletes it entirely. For now, stopping is all you need.
Getting an error with docker stop?
Make sure you're using the container ID (the alphanumeric string from the CONTAINER ID column), not the image name. You only need the first few characters of the ID for Docker to identify the container.
Help me find the correct container ID
You've successfully run your app inside a Docker container and confirmed it responds just like it did when running directly. Next up, you'll automate the entire build-and-publish workflow with GitHub Actions.
Automate with GitHub Actions
Your containerized app runs perfectly on your machine. But what about the next time you update the code? Rebuilding and pushing the image manually every single time gets old fast.
In this step, you will set up a CI/CD pipeline using GitHub Actions that automatically builds your Docker image and publishes it to GitHub Container Registry every time you push code.
In this step, get ready to:
- Push your project to a public GitHub repository.
- Create a GitHub Actions workflow that builds and pushes your Docker image.
- Verify your published container image on GitHub Container Registry.
Set up your GitHub repository and create the workflow file
Before GitHub Actions can automate anything, your code needs to live in a Git repository on GitHub.
- Initialize a Git repository in your project folder by running these commands:
git init
git add .
git commit -m "Initial commit"
What do these commands do?
- `git init` creates a new Git repository in your `docker-node-app` folder.
- `git add .` stages all your files (package.json, server.js, Dockerfile) for the first commit.
- `git commit` saves a snapshot of your project with the message "Initial commit".
Now you need a remote repository on GitHub to push your code to.
- Open your browser and go to github.com.
- In the upper-right corner of any page, click the + icon, then click New repository.
- In the Repository name field, type docker-node-app.
- Select Public for repository visibility.
- Leave all other options unchecked (no README, no .gitignore, no license).
- Click Create repository.
Why leave everything unchecked?
You already have files locally that you committed. If GitHub creates a README or .gitignore, it creates a separate commit on the remote that conflicts with your local history.
- Connect your local repository to GitHub and push your code by running these commands:
git remote add origin [[REPO_URL="https://github.com/your-username/docker-node-app.git"]]
git branch -M main
git push -u origin main
What do these commands do?
- `git remote add origin` links your local repo to the GitHub repo you just created.
- `git branch -M main` renames your default branch to `main`.
- `git push -u origin main` uploads your code to GitHub.
- Refresh your repository page on GitHub. You should see your `package.json`, `server.js`, and `Dockerfile` listed.
Push failed or authentication error?
- If you see a permission or authentication error, make sure you are signed in to Git. GitHub requires either a personal access token or SSH key for pushing.
- Double-check that the repository URL matches the one shown on your new GitHub repository page.
Ask for help: Why is my git push to GitHub failing with an authentication error?
Now you will create the workflow file that tells GitHub Actions what to do when you push code.
- Create the workflow directory by running this command:
mkdir -p .github/workflows
- In VS Code, open the Explorer sidebar.
- Expand the .github/workflows folder.
- Create a new file called deploy-image.yml inside that folder.
- Paste the following workflow configuration into deploy-image.yml:
name: Build and Push Docker Image
on:
push:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
What does this workflow do?
- `on: push: branches: ["main"]` triggers the workflow every time you push to the `main` branch.
- `env: REGISTRY: ghcr.io` sets GitHub Container Registry as the target.
- `permissions: packages: write` gives the workflow permission to push images to the registry.
- The `docker/login-action` step authenticates using the built-in `GITHUB_TOKEN` secret. No extra credentials needed.
- The `docker/metadata-action` step generates tags and labels for your image automatically.
- The `docker/build-push-action` step builds the image from your Dockerfile and pushes it to ghcr.io.
Why commit SHAs instead of version tags?
The Docker-related actions are pinned to specific commit SHAs (like `@65b78e6...`) instead of version tags (like `@v3`). This is the recommended practice from GitHub's official documentation for supply chain security. A commit SHA cannot be changed after the fact, while a tag can be moved to point at different code.
- Save deploy-image.yml.
✔️ Awesome, I've got everything!
Great. Double check you have saved your file before moving on.
ⓧ I'd like to double check the full code
Here is the complete deploy-image.yml file:
name: Build and Push Docker Image
on:
push:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Push the workflow and watch it run
The workflow file exists locally but GitHub does not know about it yet. You need to commit and push it so the automation kicks in.
- Commit and push the workflow file by running these commands:
git add .
git commit -m "Add GitHub Actions workflow"
git push
- Open your repository on GitHub in your browser.
- Click the Actions tab at the top of the repository.
You should see a workflow run in progress with a yellow dot. This is your pipeline building and pushing the Docker image.
- Wait for the workflow run to complete. It typically takes 1-2 minutes.
- Once finished, the run shows a green checkmark next to the commit message "Add GitHub Actions workflow".
Seeing a red X instead of a green checkmark?
- Click on the failed run to see the error details. The most common issue is a permissions error.
- Make sure your repository is set to Public. Private repositories on the free plan have limited Actions minutes.
- Verify that your `deploy-image.yml` file is in exactly `.github/workflows/deploy-image.yml` (the path is case-sensitive).
Ask for help: My GitHub Actions workflow failed. Help me debug it.
Find your published container image
Once the workflow succeeds, your Docker image is published to GitHub Container Registry. You can find it directly from your repository page.
- Navigate to your repository's main page on GitHub.
- Look in the right sidebar for the Packages section.
- Click on the docker-node-app package listed there.
You should see your container image details, including the image tag and the pull command. Your image is now publicly available at ghcr.io/your-username/docker-node-app.
What is ghcr.io?
ghcr.io is GitHub Container Registry. It stores container images linked directly to your GitHub account. Anyone can pull your public images without needing a Docker Hub account. Storage and bandwidth are currently free for container images on GitHub.
Don't see the Packages section?
- Make sure the workflow completed successfully (green checkmark on the Actions tab).
- It can take a minute for the package to appear after the first successful push. Refresh the repository page.
- Check that your repository is public. Container images from private repos may not show in the sidebar by default.
Ask for help: I don't see my container image in the Packages section after a successful workflow.
Secret mission
Add Environment Variables and .dockerignore
Your container works, but it's hardcoded to port 3000. Real production containers accept runtime configuration through environment variables. In this mission, you'll make your app configurable, optimize your Docker build context, and prove your container can run on any port you choose.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. This project runs locally and uses free GitHub services, so there are no ongoing costs.
Resources you used:
- Docker containers created from the docker-node-app image.
- Local Docker image docker-node-app.
- Local project folder docker-node-app on your Desktop.
- GitHub repository with your project code.
- Container image on GitHub Container Registry (ghcr.io).
- Docker Desktop application.
Keep everything running
No action needed. Choose this if you're still actively building or plan to extend this project soon.
- Your Docker image stays on your machine, ready to run containers anytime.
- Your GitHub repository and container image on ghcr.io remain available.
- Docker Desktop continues running in the background (uses some memory).
Pause - I'll come back to this later
Stop running containers and quit Docker Desktop to free up memory. Your files and images stay intact for later.
- Stop any running containers by running:
docker ps -q --filter ancestor=docker-node-app | xargs -r docker stop
- Quit Docker Desktop by right-clicking the whale icon in your system tray and selecting Quit Docker Desktop.
- Your local files, Docker image, GitHub repository, and ghcr.io image all remain untouched.
Delete - I don't want to use this again
Remove all project resources from your machine and GitHub account.
Stop and remove all containers created from your image:
docker ps -a -q --filter ancestor=docker-node-app | xargs -r docker stop
docker ps -a -q --filter ancestor=docker-node-app | xargs -r docker rm
Delete the local Docker image:
docker rmi docker-node-app
Delete the project folder from your Desktop:
macOS
cd ~/Desktop
rm -rf docker-node-app
Windows
cd $HOME\Desktop
Remove-Item -Recurse -Force docker-node-app
- Delete the GitHub repository by opening your repository page, clicking Settings, scrolling to the bottom, and selecting the option to delete the repository.
- Delete the container image from GitHub Container Registry by navigating to the package page on your GitHub profile, opening Package settings, and selecting the option to delete the package.
- Uninstall Docker Desktop by opening Windows Settings, navigating to Apps, finding Docker Desktop in the list, and selecting Uninstall.
Nice Work!
Nice Work!
Nice work! You just containerized a Node.js application and built an automated delivery pipeline that ships it to the cloud on every push.
You've learned how to:
- Written a Dockerfile to package a Node.js web server into a portable Docker image, then built and ran a container locally with port mapping.
- Created a GitHub Actions workflow that automatically builds and pushes your container image to GitHub Container Registry on every push.
- Published a container image to ghcr.io visible on your GitHub profile, proving you can ship software the way modern teams do.
- Secret Mission: Configured the app with runtime environment variables and optimized the Docker build with a .dockerignore file.
Ready to quiz yourself?