File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,4 +19,10 @@ If any step fails, the PR cannot be safely merged.
1919- Deployment happens via SSH into Azure VM
2020- Docker container is rebuilt and restarted
2121
22- This ensures continuous delivery with minimal manual intervention.
22+ This ensures continuous delivery with minimal manual intervention.
23+
24+
25+ ### Deployment Safety Controls
26+
27+ - Docker image is built and container health endpoint is validated during CI stage.
28+ - SSH based deployment ensures immutable infrastructure pattern where container is recreated on each release.
Original file line number Diff line number Diff line change 11## Production Deployment Failure Debugging Approach
22
33If production deployment fails after merge:
4-
5- 1 . Check GitHub Actions logs to identify failing stage
6- 2 . SSH into Azure VM
7- 3 . Verify Docker container status using ` docker ps `
8- 4 . Check container logs using ` docker logs `
9- 5 . Validate environment variables and port bindings
10- 6 . Test application health endpoint locally inside VM
11- 7 . Rollback to last working commit using ` git revert `
12- 8 . Rebuild Docker image and restart container
13- 9 . Monitor logs after redeployment
4+ 1 . Identify blast radius — confirm whether issue affects staging or production only.
5+ 2 . Check GitHub Actions logs to identify failing stage
6+ 3 . SSH into Azure VM
7+ 4 . Verify Docker container status using ` docker ps `
8+ 5 . Check container logs using ` docker logs `
9+ 6 . Validate environment variables and port bindings
10+ 7 . Test application health endpoint locally inside VM
11+ 8 . Rollback to last working commit using ` git revert `
12+ 9 . Rebuild Docker image and restart container
13+ 10 . Monitor logs after redeployment
1414
1515This structured approach minimizes downtime and ensures faster recovery.
Original file line number Diff line number Diff line change @@ -26,4 +26,17 @@ If deployment fails:
2626- Previous commit can be reverted
2727- Older Docker image can be redeployed
2828- Container can be restarted with previous tag
29- - GitHub Actions workflow can be re-run
29+ - GitHub Actions workflow can be re-run
30+
31+ ### Container Versioning Strategy
32+
33+ Each deployment can optionally tag Docker images using commit SHA.
34+ This enables deterministic rollback by redeploying a previous image tag.
35+
36+ ### Runtime Architecture
37+
38+ - Single Azure VM hosts two isolated Docker containers.
39+ - Production container binds to port 8000.
40+ - Staging container binds to port 8001.
41+ - Nginx acts as reverse proxy routing external traffic.
42+ - CI pipeline performs remote deployment via SSH automation.
Original file line number Diff line number Diff line change 3333
3434- GitHub Secrets
3535- Azure Key Vault
36- - Avoid storing secrets in codebase
36+ - Avoid storing secrets in codebase
37+
38+ ### Metrics and Alerting
39+
40+ - CPU and memory utilization can be monitored via Azure Monitor.
41+ - Health endpoint failure alerts can be configured.
42+ - Log aggregation systems such as ELK / Datadog can provide anomaly detection.
You can’t perform that action at this time.
0 commit comments