temp_project - GitOps Experiment
temp_project is an experiment in Docker-based GitOps deployment automation. In June 2025, the basic structure was established in a single commit.
GitOps Pattern
flowchart TD
A[Git Push] --> B[GitHub Actions]
B --> C[Docker Build]
C --> D[이미지 Push]
D --> E[환경 별 배포]
E --> F[Dev 서버]
E --> G[Staging 서버]
E --> H[Prod 서버]
I[Git Repository] -->|Single Source of Truth| B
Core Principles of GitOps
- Declarative configuration: infrastructure defined as code
- Version control: every change recorded in Git
- Automatic synchronization: Git ↔ live infrastructure kept in sync automatically
- Self-healing: drift is automatically corrected
Actual Deployment Flow
# docker-compose.yml
version: '3.8'
services:
app:
image: ${REGISTRY}/${IMAGE}:${TAG}
restart: always
environment:
- NODE_ENV=production
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
Zero-Downtime Deployment
# 롤링 업데이트
docker compose pull
docker compose up -d --no-deps --build app
# 헬스체크 대기
until curl -sf http://localhost:3000/health; do sleep 2; done
echo "배포 완료"
It was only a single-commit experiment, but this pattern became the foundation for the hr_blog2.0 and XGen deployments. Tracking every infrastructure change through Git is a habit worth building.