From e587d71f08f03af7765f5db7effc0a784ca36052 Mon Sep 17 00:00:00 2001 From: aditya singh rathore Date: Mon, 10 Nov 2025 19:31:30 +0530 Subject: [PATCH 1/3] added the icons and basic page draft --- docs/Docker/intro.md | 0 src/components/topmate/TopMateCard.tsx | 35 +++++++++++--------------- static/icons/docker.svg | 7 ++++++ 3 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 docs/Docker/intro.md create mode 100644 static/icons/docker.svg diff --git a/docs/Docker/intro.md b/docs/Docker/intro.md new file mode 100644 index 00000000..e69de29b diff --git a/src/components/topmate/TopMateCard.tsx b/src/components/topmate/TopMateCard.tsx index 524fafa0..616e569d 100644 --- a/src/components/topmate/TopMateCard.tsx +++ b/src/components/topmate/TopMateCard.tsx @@ -28,9 +28,8 @@ const TopMateCard: React.FC = ({ initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5 }} - className={`hover:shadow-3xl relative mx-auto w-full max-w-md transform overflow-hidden rounded-3xl shadow-2xl transition-all duration-300 hover:-translate-y-1 ${ - isDark ? "bg-[#1a1a1a] text-white" : "bg-white text-black" - }`} + className={`hover:shadow-3xl relative mx-auto w-full max-w-md transform overflow-hidden rounded-3xl shadow-2xl transition-all duration-300 hover:-translate-y-1 ${isDark ? "bg-[#1a1a1a] text-white" : "bg-white text-black" + }`} > {/* Decorative Arrows */}
@@ -53,27 +52,24 @@ const TopMateCard: React.FC = ({
1:1 CALL
{duration}
`, }, From 9c30c13e8b885ac6f4d70b8b4be9a397ad36bdec Mon Sep 17 00:00:00 2001 From: aditya singh rathore Date: Tue, 11 Nov 2025 18:46:35 +0530 Subject: [PATCH 3/3] added docs for docker --- docs/Docker/intro.md | 214 ++++++++++++++++++++++++------------------- 1 file changed, 121 insertions(+), 93 deletions(-) diff --git a/docs/Docker/intro.md b/docs/Docker/intro.md index c709eb3e..1a45933e 100644 --- a/docs/Docker/intro.md +++ b/docs/Docker/intro.md @@ -1,108 +1,136 @@
-# Introduction to Docker +# 🐳 Introduction to Docker
-Docker is a platform for building, shipping, and running applications in lightweight, portable containers. Containers package an application and its dependencies together, ensuring consistent behavior across development, CI, and production environments. - -## Why use Docker -- Reproducible runtime environments across machines and teams. -- Faster developer workflows (build once, run anywhere). -- Resource-efficient compared to full virtual machines. -- Simplifies dependency management and deployment pipelines. - -## Core concepts -- Image: Immutable, read-only snapshot that contains application code, runtime, libraries, and metadata. Built from a Dockerfile. -- Container: A running instance of an image; isolated filesystem, network namespace, and process tree. -- Dockerfile: Declarative text file that defines how to build an image. -- Registry: A service to store and distribute images (Docker Hub, private registries). -- Volume: Persistent storage that lives outside container lifecycle. -- Network: Isolation and connectivity between containers (bridge, host, overlay). -- Tag: Named pointer to an image version (e.g., myapp:1.0, nginx:latest). - -## Key components -- Docker Engine: The runtime that builds and runs containers. -- Docker CLI: Command-line interface (docker) to interact with the Engine. -- Docker Compose: Tool to define and run multi-container applications via YAML. -- Docker Desktop: Desktop application for macOS/Windows that bundles Engine, CLI, and tools. -- Registry/Hub: Public or private storage for images. - -## Typical workflow -1. Write a Dockerfile that describes the application image. -2. Build the image: `docker build -t myapp:latest .` -3. Run a container: `docker run -d --name myapp -p 8080:80 myapp:latest` -4. Test and iterate locally. -5. Push image to a registry: `docker push myregistry/myapp:latest` -6. Deploy by pulling the image to target hosts or orchestrator. - -## Minimal examples - -Dockerfile (simple Node.js app): +Welcome! Docker helps you package and run applications in containers—think of them as lightweight, portable boxes that contain everything your app needs to run. + +## What is Docker? + +Docker is a platform that lets you build, ship, and run applications inside containers. Instead of worrying about "it works on my machine" problems, Docker ensures your app runs the same way everywhere. + +**Simple analogy:** Just like shipping containers standardized global trade, Docker containers standardize software deployment. Your application + its dependencies = one portable package. + +## Why Use Docker? + +- **Consistency** - Same behavior on your laptop, your teammate's computer, and production servers +- **Fast setup** - New developers can start working in minutes instead of days +- **Isolation** - Each app runs in its own environment without conflicts +- **Efficiency** - Containers are lightweight and start in seconds +- **Portability** - Build once, run anywhere + +## Core Concepts + +### Image +A blueprint for your application. Contains your code, runtime, libraries, and configuration. Images are built from a **Dockerfile** and never change once created. + +### Container +A running instance of an image. Lightweight, isolated, and disposable. You can run multiple containers from the same image. + +### Dockerfile +A simple text file with instructions to build an image: ```dockerfile FROM node:18-alpine WORKDIR /app COPY package*.json ./ -RUN npm ci --production +RUN npm install +COPY . . +CMD ["node", "app.js"] +``` + +### Registry +A storage service for Docker images. **Docker Hub** is the most popular—like GitHub for Docker images. + +### Volume +Persistent storage that survives when containers are deleted. Use for databases, logs, and user files. + +### Network +Allows containers to communicate with each other securely. + +## Quick Start Workflow + +**1. Create a Dockerfile** +```dockerfile +FROM python:3.11-slim +WORKDIR /app +COPY requirements.txt . +RUN pip install -r requirements.txt COPY . . -CMD ["node", "server.js"] +CMD ["python", "app.py"] ``` -Run an nginx container: +**2. Build your image** ```bash -docker run -d --name web -p 80:80 nginx:stable +docker build -t my-app:1.0 . ``` -docker-compose.yml (web + redis): -```yaml -version: "3.8" -services: - web: - build: . - ports: - - "8080:80" - depends_on: - - redis - redis: - image: redis:7-alpine +**3. Run a container** +```bash +docker run -d --name my-app -p 8000:8000 my-app:1.0 +``` + +**4. Check it's running** +```bash +docker ps +docker logs my-app ``` -Start: `docker compose up -d` - -## Useful commands -- Build: `docker build -t myapp:tag .` -- Run: `docker run -d -p 80:80 --name app myapp:tag` -- List running containers: `docker ps` -- List images: `docker images` -- Exec into container: `docker exec -it app /bin/sh` -- Logs: `docker logs -f app` -- Remove container/image: `docker rm app`, `docker rmi myapp:tag` -- Compose: `docker compose up -d`, `docker compose logs -f` - -## Best practices -- Use small base images (alpine, distroless) when possible. -- Follow multi-stage builds to reduce final image size. -- Do not store secrets in images; use environment variables, secrets managers, or Docker Secrets. -- Keep images immutable and versioned with tags. -- Add a .dockerignore file to speed builds and avoid leaking files. -- Run processes as non-root inside containers when feasible. -- Add HEALTHCHECK to images for orchestration health reporting. - -## Security considerations -- Scan images for vulnerabilities regularly. -- Minimize installed packages and attack surface. -- Use official or trusted base images. -- Pin image digests or tags for reproducible deployments. -- Limit container capabilities and use user namespaces or seccomp profiles. - -## Troubleshooting tips -- If container fails to start: check `docker logs ` and `docker inspect `. -- Network issues: inspect networks (`docker network ls`, `docker network inspect`). -- Build issues: add `--progress=plain` and check Dockerfile layers; use `docker build --no-cache` to force rebuild. - -## Next steps / learning path -- Install Docker Desktop (Windows/macOS) or Docker Engine (Linux). -- Learn Dockerfile best practices and multi-stage builds. -- Learn Docker Compose for multi-container dev environments. -- Explore orchestration: Kubernetes or Docker Swarm for production-scale deployments. -- Read the official docs: https://docs.docker.com/ - -This file should serve as a concise reference for getting started with Docker and as a base to link to more detailed guides (Dockerfile patterns, Compose, security hardening, CI/CD integrations). \ No newline at end of file + +That's it! Your app is now running in a container. + +## Essential Commands + +```bash +# Build an image +docker build -t myapp:1.0 . + +# Run a container +docker run -d --name myapp -p 8080:80 myapp:1.0 + +# List running containers +docker ps + +# View logs +docker logs myapp + +# Stop a container +docker stop myapp + +# Remove a container +docker rm myapp + +# List images +docker images + +# Remove an image +docker rmi myapp:1.0 +``` + + +## Best Practices + +✅ **Use official base images** - `node:18-alpine`, `python:3.11-slim` +✅ **Use specific tags** - Avoid `:latest` in production +✅ **Keep images small** - Use Alpine or slim variants +✅ **Add .dockerignore** - Exclude `node_modules`, `.git`, logs +✅ **Don't run as root** - Create a non-privileged user +✅ **Use volumes for data** - Never store important data in containers +✅ **One process per container** - Keep it simple and focused + + +## Next Steps + +1. **Install Docker** - Get Docker Desktop (Mac/Windows) or Docker Engine (Linux) +2. **Try the examples** - Build and run the sample Dockerfiles above +3. **Learn Docker Compose** - Manage multi-container apps easily +4. **Explore Docker Hub** - Find pre-built images for databases, web servers, etc. +5. **Read the docs** - https://docs.docker.com/ + +## Key Takeaways + +- **Containers** package your app with everything it needs +- **Images** are blueprints, containers are running instances +- **Dockerfiles** define how to build images +- **Docker Compose** manages multiple containers together +- Docker makes development, testing, and deployment much easier + +Ready to containerize your first app? Start with a simple Dockerfile and experiment! 🚀 \ No newline at end of file