Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Tag: Container Health

Docker

Docker Healthcheck: Monitor Container Health Like a Pro

- 23.08.26 - ErcanOPAK comment on Docker Healthcheck: Monitor Container Health Like a Pro

❤️ Key Takeaways: Docker healthchecks automatically monitor and recover unhealthy containers. Essential for production workloads. Containers can hang, crash, or become unresponsive. Healthchecks detect and recover them automatically. 🔥 Dockerfile Healthcheck # ✅ Dockerfile healthcheck for .NET API FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app COPY –from=build /app/publish . # ✅ Healthcheck configuration HEALTHCHECK –interval=30s –timeout=5s –start-period=30s –retries=3 […]

Read More
Docker

Docker: Add Health Checks to Containers

- 20.06.26 - ErcanOPAK comment on Docker: Add Health Checks to Containers

❤️ Is Your Container Actually Working? Container running but app crashed? Health checks test app responsiveness. Automatically restart unhealthy containers. 📝 Health Check in Dockerfile # Web app HEALTHCHECK –interval=30s –timeout=3s –start-period=5s –retries=3 \ CMD curl -f http://localhost/ || exit 1 # Database HEALTHCHECK –interval=30s –timeout=10s –retries=5 \ CMD pg_isready -U postgres || exit 1 […]

Read More
Docker

Docker: Add Health Checks to Detect Unhealthy Containers

- 28.05.26 - ErcanOPAK comment on Docker: Add Health Checks to Detect Unhealthy Containers

❤️ Is Your Container Actually Working? Container running but app crashed? Health checks test if app is responsive. Automatically restart unhealthy containers. 📝 Dockerfile Healthcheck # Web app HEALTHCHECK –interval=30s –timeout=3s –start-period=5s –retries=3 \ CMD curl -f http://localhost/ || exit 1 # Database HEALTHCHECK –interval=30s –timeout=10s –retries=5 \ CMD pg_isready -U postgres || exit 1 […]

Read More
Asp.Net Core

.NET Core: Use Health Checks to Monitor Application Status

- 15.02.26 - ErcanOPAK comment on .NET Core: Use Health Checks to Monitor Application Status

Need to know if your app is healthy? Health checks provide monitoring endpoints automatically. Setup: // Program.cs builder.Services.AddHealthChecks() .AddDbContextCheck() // Check database .AddUrlGroup(new Uri(“https://api.example.com”), “External API”); // Check external dependency var app = builder.Build(); app.MapHealthChecks(“/health”); Test: curl http://localhost:5000/health # Healthy response: 200 OK # Unhealthy: 503 Service Unavailable Custom Health Check: public class MemoryHealthCheck : […]

Read More
Docker

Docker: UseHealthCheck to Auto-Restart Unhealthy Containers

- 14.02.26 - ErcanOPAK comment on Docker: UseHealthCheck to Auto-Restart Unhealthy Containers

Container running but app inside crashed? Add HEALTHCHECK to auto-detect and restart failed containers. Add to Dockerfile: FROM node:18 WORKDIR /app COPY . . # Check if app responds on port 3000 HEALTHCHECK –interval=30s –timeout=3s –retries=3 \ CMD curl -f http://localhost:3000/health || exit 1 CMD [“node”, “server.js”] What Happens: Every 30 seconds, Docker runs health […]

Read More
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (653)
  • Add Constraint to SQL Table to ensure email contains @ (609)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (547)
  • Find numbers with more than two decimal places in SQL (475)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com