🚀 Day 58 of Daily Docker Commands! Ever been in the middle of development and need to quickly rebuild just one service without waiting for your entire stack to restart? I've been there so many times! Today's lifesaver: docker-compose up -d --force-recreate web This command forces Docker Compose to recreate your specific web service container, even if nothing appears to have changed. The --force-recreate flag is the magic here - it tells Docker to rebuild from scratch, ensuring your latest code changes are reflected. 🧠 Pro tip to remember: Think "Force Recreation Web" - I always remember it as "FRW" (Force Recreate Web) when I need that quick development refresh! Real-world scenarios: 🎯 Beginner: You're learning React and made changes to your frontend code. Instead of rebuilding everything, just recreate your web container: docker-compose up -d --force-recreate frontend 💼 Professional Scenario 1: You're debugging a production issue and need to deploy a hotfix to just your API service without touching the database or cache: docker-compose up -d --force-recreate api 💼 Professional Scenario 2: You've updated environment variables for your web service and normal restart isn't picking them up: docker-compose up -d --force-recreate web-server This approach saves precious development time and keeps your workflow smooth. No more waiting for unnecessary container rebuilds! ⏰ What's your go-to Docker command for quick development iterations? Drop it in the comments! 👇 #Docker #DevOps #Development #Containers #TechTips #SoftwareEngineering My YT channel Link: https://lnkd.in/d99x27ve
Docker Compose Quick Restart with --force-recreate
More Relevant Posts
-
🚀 𝗣𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻‐𝗥𝗲𝗮𝗱𝘆 𝗗𝗼𝗰𝗸𝗲𝗿: 𝗪𝗵𝘆 𝗠𝘂𝗹𝘁𝗶‐𝗦𝘁𝗮𝗴𝗲 𝗕𝘂𝗶𝗹𝗱𝘀 𝗔𝗿𝗲 𝗮 𝗠𝘂𝘀𝘁 🐳 𝗗𝗼𝗰𝗸𝗲𝗿𝗳𝗶𝗹𝗲 # 𝗦𝘁𝗮𝗴𝗲 𝟭: 𝗕𝘂𝗶𝗹𝗱 FROM node:16.20.2 AS builder WORKDIR /app COPY package*.json ./ RUN npm install COPY . . RUN npm run build # 𝗦𝘁𝗮𝗴𝗲 𝟮: 𝗣𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻 FROM nginx:alpine AS production COPY --from=builder /app/build /usr/share/nginx/html --- 🔍 𝗦𝘁𝗲𝗽-𝗯𝘆-𝗦𝘁𝗲𝗽 (𝗪𝗵𝗮𝘁 & 𝗪𝗵𝘆) 🔹 𝘍𝘙𝘖𝘔 𝘯𝘰𝘥𝘦:16 𝘈𝘚 𝘣𝘶𝘪𝘭𝘥𝘦𝘳 Creates a build environment with Node.js 👉 Needed to install dependencies & compile the app 🔹 𝘞𝘖𝘙𝘒𝘋𝘐𝘙 /𝘢𝘱𝘱 Sets a dedicated working directory 👉 Keeps file structure clean and consistent 🔹 𝘊𝘖𝘗𝘠 𝘱𝘢𝘤𝘬𝘢𝘨𝘦.𝘫𝘴𝘰𝘯* Copies only dependency files 👉 Enables Docker layer caching → faster rebuilds 🔹 𝘙𝘜𝘕 𝘯𝘱𝘮 𝘪𝘯𝘴𝘵𝘢𝘭𝘭 Installs dependencies inside container 👉 Required before building the app 🔹 𝘊𝘖𝘗𝘠 . . Copies full source code 👉 Done after install to avoid cache invalidation 🔹 𝘙𝘜𝘕 𝘯𝘱𝘮 𝘳𝘶𝘯 𝘣𝘶𝘪𝘭𝘥 Generates optimized static files 👉 Output goes to "/app/build" --- 🔹 𝘍𝘙𝘖𝘔 𝘯𝘨𝘪𝘯𝘹:𝘢𝘭𝘱𝘪𝘯𝘦 Starts a fresh, lightweight runtime image 👉 No Node.js → smaller & more secure 🔹 𝘊𝘖𝘗𝘠 --𝘧𝘳𝘰𝘮=𝘣𝘶𝘪𝘭𝘥𝘦𝘳 Copies only build output from previous stage 👉 Keeps final image minimal (no source code, no node_modules) --- ⚙️ 𝗔𝘁 𝗥𝘂𝗻𝘁𝗶𝗺𝗲 - Container runs on Nginx - Static files are served from "/usr/share/nginx/html" - Application is accessible via browser --- ⚡ 𝗪𝗵𝘆 𝗧𝗵𝗶𝘀 𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵? ✔ Smaller image size ✔ Faster deployments ✔ Better security ✔ Clean separation: Build vs Runtime --- 💡 𝗞𝗲𝘆 𝗗𝗲𝘃𝗢𝗽𝘀 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆 Don’t ship your build tools to production. Use multi-stage builds to keep your containers lean, secure, and efficient. 🚀 𝗟𝗲𝗮𝗻 𝗰𝗼𝗻𝘁𝗮𝗶𝗻𝗲𝗿𝘀 = 𝗳𝗮𝘀𝘁𝗲𝗿 𝘀𝘆𝘀𝘁𝗲𝗺𝘀 + 𝗯𝗲𝘁𝘁𝗲𝗿 𝗗𝗲𝘃𝗢𝗽𝘀 DevOps Insiders #Docker #DevOps #Infrastructure #DevopsInsiders #Architecture #Learning #TechForEveryone #CloudNative #Containers #Microservices #CICD #SoftwareEngineering #BestPractices #Security #Performance #TechLeadership #EngineeringExcellence
To view or add a comment, sign in
-
-
I was building a Kanban board and ran into a classic React problem. Everything was re-rendering even with normalized state. My first instinct was React Context. Turns out that doesn't actually fix it. Even if you selectively read a value, the component still subscribes to the entire context object under the hood. The real fix is Zustand's selector pattern, where components only re-render when the exact slice of state they care about changes. Wrote about the whole journey here 👇 https://lnkd.in/df7mU8g5 #reactjs #webdev #javascript #zustand
To view or add a comment, sign in
-
A lot of developers think async/await makes code run faster but it actually doesn't. Adding async and await to your functions doesn't magically speed anything up. A lot of people see "async" and think it means faster execution. That's not what it does at all. What async/await actually does is pretty simple: It makes asynchronous code easier to read and write. That's it. The actual speed depends entirely on what you're awaiting and how you structure your code. When you write await fetchUser(), your code stops and waits for that function to finish before moving to the next line. If fetching a user takes 2 seconds, you're waiting 2 seconds. Nothing actually got faster here. Where people usually get confused is when they write code like this and think it's optimized: const user = await fetchUser(); const posts = await fetchPosts(); const comments = await fetchComments(); Each await waits for the previous one to finish completely. If each takes 2 seconds, the total time is 6 seconds. They run one after another, not simultaneously. But you could start all three at the same time and wait for them together: const [user, posts, comments] = await Promise.all([ fetchUser(), fetchPosts(), fetchComments() ]); Now all three requests fire off immediately. The total time is 2 seconds whatever the slowest one takes. That's 3x faster, and async/await had nothing to do with it. Promise.all did. Async/await is about writing cleaner code, not faster code. It lets you avoid callback hell and write asynchronous operations that look synchronous. Readability, not speed. Speed comes from how you structure your promises, like running things in parallel when you can instead of waiting for each one to finish one by one.
To view or add a comment, sign in
-
I built an interactive CI/CD pipeline guide for developers and deployed it live. When I started learning CI/CD, I couldn't find a single resource that showed the full picture from the local host all the way to production. So I built one. 🔗 https://lnkd.in/gUZ7Yvv6 Important: this is a sample workflow. The tools change based on your stack and team size — swap Vercel for AWS, Render for Railway, Playwright for Cypress, Pytest for unittest. The pipeline structure stays the same. Here's what the sample covers, step by step: ✅ GitHub repo setup — branch protection, secrets, auto-merge ✅ Vercel — frontend staging + production deploy ✅ Render — backend staging + production (Node.js / FastAPI) ✅ GitHub Actions — branch CI that runs on every PR ✅ Playwright — E2E testing against your staging URL ✅ Vitest / Pytest — unit tests that block bad PRs ✅ Manual approval gate before production ✅ Dependabot — automatic security patches ✅ BetterStack — uptime monitoring Every step has copy-paste commands and workflow YAML files. The concepts apply to any stack. If you've been putting off setting up a proper CI/CD pipeline, this is your starting point. Adapt it to your tools. Share with a dev who needs it 👇 #CICD #DevOps #GitHub #GitHubActions #WebDevelopment #Vercel #Render #Playwright #OpenSource
To view or add a comment, sign in
-
Everyone's telling beginners to "just build projects." But nobody warns you about this: Week 1: "HTML is easy." Week 3: "CSS is gaslighting me." Week 6: "JavaScript has HOW many frameworks?" Week 10: "Wait — I also need databases, APIs, auth, deployment AND DevOps?!" And after all that, you build a todo app that nobody uses. Here's what I actually think moves the needle faster: contribute to something real. Something with actual users. Even in the smallest way. Debug a real bug. Fix a real UI. The feedback loop hits different. Nobody tells you the map keeps expanding. But that's also what makes it addictive. To anyone in the thick of it — you're not behind. The map is just bigger than they showed you. What do you wish someone told you when you started? 👇
To view or add a comment, sign in
-
How to Install #GitLab on #AlmaLinux #VPS Easily In this tutorial we are going to show you in detail how to install Gitlab on AlmaLinux VPS. What is GitLab? GitLab is open-source #software written in Ruby, Go and JavaScript operated by GitLab Inc. GitLab offers a wide range of features such as CI/CD (Continuous Integration, Continuous Delivery) which makes the work of developers and administrators straightforward and simple. Installing GitLab on AlmaLinux VPS is a straightforward process ... Keep Reading 👉 https://lnkd.in/gVkTDsAx #installguide #rubygems #dedicatedserver #selfhosted #rubyonrails #selfhosting
To view or add a comment, sign in
-
How to Install #GitLab on #AlmaLinux #VPS Easily In this tutorial we are going to show you in detail how to install Gitlab on AlmaLinux VPS. What is GitLab? GitLab is open-source #software written in Ruby, Go and JavaScript operated by GitLab Inc. GitLab offers a wide range of features such as CI/CD (Continuous Integration, Continuous Delivery) which makes the work of developers and administrators straightforward and simple. Installing GitLab on AlmaLinux VPS is a straightforward process ... Keep Reading 👉 https://lnkd.in/gQnpmbnG #installguide #rubyonrails #selfhosting #dedicatedserver #selfhosted #rubygems
To view or add a comment, sign in
-
If you're using Claude Code without setting up claude folder, you re üsing 10% of it. Claude.ai The .claude folder is where Claude Code actually lives. Everything you wish Claude Code did out of the box is sitting inside this folder. Most vibe coders never open it. They install Claude Code, run a few prompts, hit a wall, and assume that's the ceiling. It's not. Instead have these canonical files that Claude Code reads: CLAUDE.md→ Your project rulebook. Coding style, conventions, gotchas. Claude reads it before every task so you stop repeating yourself in every prompt. Advisory, not enforced. .claude/hooks/→ Deterministic. Fires every single time. Auto-commit after edits, load project context on startup, save state before compaction. Claude doesn't get to skip these. .claude/skills/ → Drop a SKILL.md inside any folder and Claude knows exactly when to invoke it. I have one for carousel generation, one for pacing drills. Claude picks the right one based on the task. .claude/agents/→ Subagents with their own isolated context window. Code reviewer, researcher, log analyzer. They run in parallel and report back. Your main thread stays clean. .claude/commands/→ Slash commands. Legacy but still works. Build a /ship command that lints, builds, and deploys in one go. .claude/plugins/ First-class in 2026. Bundle hooks, skills, agents, and MCP servers into one shareable package. This is the real unlock. .claude/rules/ → Path-scoped. Loads only when filesmatch a glob. So your API rules don't pollute your frontend work. .mcp.json → Sits at the project root, not inside .claude. MCP servers your project uses. Claude connects them automatically. The pattern most people miss: CLAUDE.md is advisory. Hooks are deterministic. Skills load on demand. That's the whole mental model. Once you understand which file does what, Claude Code stops feeling like another normal chatbot and starts feeling like a 10X developer. Over to you: Do you have hooks set up in your .claude folder? .claude/ folder, fully mapped
To view or add a comment, sign in
-
-
I Built & Published My First NPM Package — api-error-translator Yesterday, I launched my first npm package, and it solves a very real problem I kept facing while building backend systems And the best part 👇 -- Already 192+ weekly downloads (within 1 day) The Problem Whenever a validation error happens in the backend, it usually looks like this: { "error": "ValidationError: Path `email` is required" } Now the issue is: • This message is not clean • Every backend library returns errors in different formats • Hard for frontend to understand and display properly • Same parsing logic has to be written again and again in every project Result: messy code + wasted time The Solution I built a simple utility — api-error-translator What it does: -- Takes raw backend errors -- Converts them into a clean, consistent, frontend-friendly format Example: { "message": "Email is required", "field": "email" } Why It’s Useful • Easy to show errors directly in UI • Same structure everywhere (consistency) • Cleaner codebase • Saves development time • Makes debugging simpler Where You Can Use It • Node.js backend APIs • Projects with forms & validations • LMS, admin panels, placement systems, etc. Try It Here -- https://lnkd.in/gb7CCZqz Install: npm i api-error-translator What’s Next • Better support for libraries like Mongoose, Joi, Zod • More customization options • Framework-specific integrations If you're a backend or full-stack developer, this can make your workflow much smoother. Would love your feedback 🙌 Give it a try and let me know what you think! #NodeJS #NPM #JavaScript #BackendDevelopment #WebDevelopment #OpenSource #DeveloperTools
To view or add a comment, sign in
-
-
How to Install #GitLab on #AlmaLinux #VPS Easily In this tutorial we are going to show you in detail how to install Gitlab on AlmaLinux VPS. What is GitLab? GitLab is open-source #software written in Ruby, Go and JavaScript operated by GitLab Inc. GitLab offers a wide range of features such as CI/CD (Continuous Integration, Continuous Delivery) which makes the work of developers and administrators straightforward and simple. Installing GitLab on AlmaLinux VPS is a straightforward process ... Keep Reading 👉 https://lnkd.in/gN7S8Bcq #dedicatedserver #rubyonrails #selfhosting #selfhosted #rubygems #installguide
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development