Skip to content

docs: added a guide for Dockerized React.js 19 application #22375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kristiyan-velkov
Copy link

Description

This PR introduces a comprehensive, language-specific guide for containerizing React.js applications using Docker, aimed at helping developers streamline development, testing, and deployment workflows. It includes practical steps and examples to set up CI/CD pipelines using GitHub Actions, aligning with modern DevOps best practices.

What’s Included

  • Step-by-step instructions to containerize React.js apps using Docker.
  • Configuration for a local development environment inside containers.
  • Guidance on running unit tests inside Docker containers.
  • Full CI/CD pipeline setup using GitHub Actions for automated builds and deployments.
  • Deployment instructions for a local Kubernetes cluster to validate production readiness.

Credits
Krisityan Velkov, Docker Captain and experienced Front-end Engineer.

…ge documentation

[feat] imrpove build images section

[feat] updated the containerize react.js guide

[feat] added documentation for how to develop and test react.js application

[feat] added files for deploy, ci/cd

[feat] added page ci-cd

[feat] added deployment documentation for React.js application

[feat] improve the react.js guide

[feat] improve react.hs documentation to follow the same strcuture
Copy link

netlify bot commented Apr 6, 2025

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 932b344
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/67f8ed8445742d000834c5db
😎 Deploy Preview https://deploy-preview-22375--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kristiyan-velkov kristiyan-velkov changed the title docs: add a guide for Dockerized React.js 19 application docs: added a guide for Dockerized React.js 19 application Apr 6, 2025
@craig-osterhout craig-osterhout requested a review from a team April 8, 2025 21:15
Copy link
Contributor

@craig-osterhout craig-osterhout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kristiyan-velkov. It looks great. I really like the formatting you did for the docker init command. I'm going to steal that for the other guides.

I left a lot of petty style nits. You can refer to the style guide or let me know if any questions. The biggest offender was bolding. Typically, we only use it for UI text.


The React.js language-specific guide shows you how to containerize a React.js application using Docker, following best practices for creating efficient, production-ready containers.

[React.js](https://react.dev/) is a widely used library for building interactive user interfaces. However, managing dependencies, environments, and deployments efficiently can be complex. **Docker** simplifies this process by providing a consistent and containerized environment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[React.js](https://react.dev/) is a widely used library for building interactive user interfaces. However, managing dependencies, environments, and deployments efficiently can be complex. **Docker** simplifies this process by providing a consistent and containerized environment.
[React.js](https://react.dev/) is a widely used library for building interactive user interfaces. However, managing dependencies, environments, and deployments efficiently can be complex. Docker simplifies this process by providing a consistent and containerized environment.

---
title: Containerize a React.js Application
linkTitle: Containerize
weight: 50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
weight: 50
weight: 10

weight: 50
keywords: react.js, node, image, initialize, build
description: Learn how to containerize a React.js application with Docker by creating an optimized, production-ready image using best practices for performance, security, and scalability.
aliases:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aliases:

keywords: react.js, node, image, initialize, build
description: Learn how to containerize a React.js application with Docker by creating an optimized, production-ready image using best practices for performance, security, and scalability.
aliases:
- /language/react.js/build-images/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- /language/react.js/build-images/

aliases:
- /language/react.js/build-images/
- /language/react.js/run-containers/
- /language/react.js/containerize/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- /language/react.js/containerize/


**This manifest defines two key Kubernetes resources, separated by `---`**:

- **Deployment**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Deployment**
- Deployment

(refer to [Configure CI/CD for your React.js application](configure-ci-cd.md)).
The container listens on port `8080`, which is typically used by [Nginx](https://nginx.org/en/docs/) to serve your production React app.

- **Service (NodePort)**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Service (NodePort)**
- Service (NodePort)


This output confirms that your app is available via NodePort on port 30001.

### Step 4.Access your app in the browser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Step 4.Access your app in the browser
### Step 4. Access your app in the browser


## Summary

In this section, you learned how to deploy your **React.js application** to a local Kubernetes cluster using **Docker Desktop**. This setup allows you to test and debug your containerized app in a production-like environment before deploying it to the cloud.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this section, you learned how to deploy your **React.js application** to a local Kubernetes cluster using **Docker Desktop**. This setup allows you to test and debug your containerized app in a production-like environment before deploying it to the cloud.
In this section, you learned how to deploy your React.js application to a local Kubernetes cluster using Docker Desktop. This setup allows you to test and debug your containerized app in a production-like environment before deploying it to the cloud.


In this section, you learned how to deploy your **React.js application** to a local Kubernetes cluster using **Docker Desktop**. This setup allows you to test and debug your containerized app in a production-like environment before deploying it to the cloud.

**What you accomplished:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**What you accomplished:**
What you accomplished:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants