λμΉ΄(DaeCar) νλ‘μ νΈμ μΈνλΌ μ€μ λ° λ°°ν¬λ₯Ό μν λ ν¬μ§ν 리μ λλ€.
μ΄ λ ν¬μ§ν 리λ λ€μμ ν¬ν¨ν©λλ€:
- κ°λ° νκ²½: HTTP κΈ°λ° λ‘컬 κ°λ° νκ²½
- λ°°ν¬ νκ²½: Let's Encrypt HTTPS κΈ°λ° νλ‘λμ νκ²½
- CI/CD: Jenkins νμ΄νλΌμΈ
- μΈνλΌ: MySQL, Redis, RabbitMQ, Nginx
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Frontend ββββββ Nginx ββββββ Backend β
β β β (Reverse β β (Spring Boot) β
βββββββββββββββββββ β Proxy) β βββββββββββββββββββ
ββββββββββββββββ
β
βββββββββββΌββββββββββ
β β β
βββββββββΌββββ βββββΌββββ βββββΌβββββββ
β MySQL β β Redis β β RabbitMQ β
β β β β β β
βββββββββββββ βββββββββ ββββββββββββ
# 1. λ ν¬μ§ν 리 ν΄λ‘
git clone <repository-url>
cd DaeCar_INFRA
# 2. κ°λ° νκ²½ μμ
cd docker-compose
docker-compose up -d
# 3. μ μ νμΈ
curl http://localhost
κ°λ° νκ²½ μ μ μ£Όμ:
- π λ©μΈ νμ΄μ§: http://localhost
- π Swagger UI: http://localhost/swagger-ui/
- π API: http://localhost/api/
- π° RabbitMQ κ΄λ¦¬: http://localhost:15672 (guest/guest)
# 1. νκ²½ λ³μ μ€μ
cp .env.example .env
# .env νμΌμ νΈμ§νμ¬ μ€μ λλ©μΈκ³Ό ν¨μ€μλ μ€μ
# 2. SSL μΈμ¦μ λ°κΈ λ° λ°°ν¬
./scripts/deploy-ssl.sh
# 3. μλΉμ€ μν νμΈ
cd docker-compose
docker-compose -f docker-compose.prod.yml ps
DaeCar_INFRA/
βββ docker-compose/
β βββ docker-compose.yml # κ°λ° νκ²½
β βββ docker-compose.prod.yml # λ°°ν¬ νκ²½
βββ nginx/
β βββ nginx.dev.conf # κ°λ°μ© μ€μ (HTTP)
β βββ nginx.prod.conf # λ°°ν¬μ© μ€μ (HTTPS)
β βββ index.html # λ©μΈ νμ΄μ§
βββ scripts/
β βββ generate-ssl-cert.sh # μ체 μλͺ
μΈμ¦μ μμ±
β βββ deploy-ssl.sh # Let's Encrypt λ°°ν¬
βββ ssl/ # SSL μΈμ¦μ μ μ₯μ
βββ jenkins/
β βββ deploy-jenkinsfile # CI/CD νμ΄νλΌμΈ
βββ .env.example # νκ²½ λ³μ μμ
βββ README.md
- Nginx: HTTP 리λ²μ€ νλ‘μ (ν¬νΈ 80)
- MySQL: 8.0 (ν¬νΈ 3306, root/rootpassword)
- Redis: 7-alpine (ν¬νΈ 6379, ν¨μ€μλ μμ)
- RabbitMQ: 3-management (ν¬νΈ 5672, 15672)
- Nginx: HTTPS 리λ²μ€ νλ‘μ (ν¬νΈ 80 β 443)
- MySQL: 8.0 (νκ²½λ³μ κΈ°λ° ν¨μ€μλ)
- Redis: 7-alpine (ν¨μ€μλ 보νΈ)
- RabbitMQ: 3-management (ν¨μ€μλ 보νΈ)
- Certbot: Let's Encrypt μλ κ°±μ
- HTTP μ μ© (SSL μμ)
- κΈ°λ³Έ ν¨μ€μλ μ¬μ©
- λͺ¨λ ν¬νΈ λ ΈμΆ
- HTTPS κ°μ : HTTP β HTTPS 리λ€μ΄λ νΈ
- SSL/TLS: Let's Encrypt μΈμ¦μ, TLS 1.2/1.3
- 보μ ν€λ: HSTS, CSP, X-Frame-Options λ±
- Rate Limiting: API νΈμΆ μ ν (10req/s)
- ν¨μ€μλ 보νΈ: λͺ¨λ μλΉμ€ κ°λ ₯ν ν¨μ€μλ
- λ‘κ·Έ κ΄λ¦¬: ꡬ쑰νλ JSON λ‘κ·Έ
.env
νμΌμμ λ€μ λ³μλ€μ μ€μ νμΈμ:
# λλ©μΈ μ€μ
DOMAIN=your-domain.com
SSL_EMAIL=admin@your-domain.com
# λ°μ΄ν°λ² μ΄μ€
MYSQL_ROOT_PASSWORD=secure_password
MYSQL_PASSWORD=user_password
# Redis
REDIS_PASSWORD=redis_password
# RabbitMQ
RABBITMQ_USER=admin
RABBITMQ_PASSWORD=rabbitmq_password
./scripts/deploy-ssl.sh
cd docker-compose
docker-compose -f docker-compose.prod.yml run --rm certbot-renew
docker-compose -f docker-compose.prod.yml restart nginx
# crontab -eμ μΆκ°
0 2 * * * cd /path/to/DaeCar_INFRA/docker-compose && docker-compose -f docker-compose.prod.yml run --rm certbot-renew && docker-compose -f docker-compose.prod.yml restart nginx
# κ°λ° νκ²½
curl http://localhost/health
# λ°°ν¬ νκ²½
curl https://your-domain.com/health
# κ°λ° νκ²½
docker-compose ps
# λ°°ν¬ νκ²½
docker-compose -f docker-compose.prod.yml ps
# νΉμ μλΉμ€ λ‘κ·Έ
docker-compose logs -f nginx
# λͺ¨λ μλΉμ€ λ‘κ·Έ
docker-compose logs -f
# μΈμ¦μ μν νμΈ
openssl x509 -in ssl/letsencrypt/live/your-domain.com/fullchain.pem -text -noout
# μΈμ¦μ λ§λ£μΌ νμΈ
openssl x509 -enddate -noout -in ssl/letsencrypt/live/your-domain.com/fullchain.pem
# ν¬νΈ νμΈ
netstat -tlnp | grep -E ':80|:443'
# DNS νμΈ
nslookup your-domain.com
# 컨ν
μ΄λ μ¬μμ
docker-compose restart nginx
# λ‘κ·Έ νμΈ
docker-compose logs nginx
λ¬Έμ κ° λ°μνλ©΄ λ€μμ νμΈνμΈμ:
- νκ²½ λ³μ:
.env
νμΌ μ€μ νμΈ - DNS μ€μ : λλ©μΈμ΄ μλ² IPλ₯Ό κ°λ¦¬ν€λμ§ νμΈ
- λ°©νλ²½: 80, 443 ν¬νΈ κ°λ°© νμΈ
- λ‘κ·Έ:
docker-compose logs
λ‘ μλ¬ λ©μμ§ νμΈ
Team 3rd - 2025 μΆ©λ¨ ν΄μ»€ν€ ππ¨