<!-- (1) Add a brief introduction about docker here! -->
-**Docker** is a platform for developing, shipping, and running applications inside lightweight, portable **containers**.
- A **container** is a standardized unit that packages an application along with its dependencies, environment variables, and configuration.
- Benefits:
-**Consistency**: "It runs on my machine" actually works on *every* machine.
-**Isolation**: Prevents conflicts between different environments or services.
-**Portability**: Containers can be moved across systems (e.g., from development to production) without changes.
-**Key Concepts**:
-**Image**: A blueprint of the container (think: frozen snapshot of the app + config).
-**Container**: A running instance of an image.
-**Dockerfile**: Script to define how to build the image.
-**Docker Compose**: Tool to define and run multi-container apps.
</div>
@@ -107,7 +117,11 @@ flowchart TD
<divstyle="font-size: 20pt">
<!-- (2) Add some explanation and a mermaid visualization of the docker containerization of the tornado blog demo here! -->
- The **Tornado Blog Demo** can be packaged into a Docker container to ensure consistent development and deployment.
- Structure:
- A single container runs the Tornado application.
- It connects to a separate PostgreSQL container for the database.
- Docker Compose is typically used to orchestrate both services.
</div>
@@ -217,7 +231,20 @@ graph TD
<divstyle="font-size: 20pt">
<!-- (3) Add some explanation of the stages to develop and build a react app here -->
-**Steps to develop and build a React app**:
1.**Development**:
- Set up the project using tools like `create-react-app` or Vite.
- Write components using JSX or TypeScript.
- Test locally with `npm start` (serves the app on `localhost:3000`).
2.**Build**:
- Run `npm run build` to create a production-optimized bundle (static HTML/CSS/JS in `build/`).
3.**Deployment**
- Serve the production-optimized bunlde e.g. via nginx in
-`/data/www`
-`/usr/share/nginx/html`
</div>
@@ -227,10 +254,31 @@ graph TD
<divstyle="font-size: 20pt">
<!-- (4) Add some explanation and a mermaid visualization of the docker containerization of the tornado blog demo with a react frontend for development here! -->
- In a **full-stack setup**, we containerize both the **React frontend** and the **Tornado backend**.
- Each service runs in its own container.
- During development, React runs on a live-reload dev server.
- Backend connects to a database container (e.g., PostgreSQL).
- Services communicate via a shared Docker network.