feat: Complete deployment setup for code pushes

- Add pre-flight checks in deploy-update.yml
- Automatically copy docker-compose.yml and nginx config in setup-infrastructure.yml
- Add comprehensive deployment documentation
- Ready for automated code deployments via CI/CD pipeline
This commit is contained in:
2025-10-31 10:31:56 +01:00
parent 6deca7838e
commit de8fed8711
12 changed files with 1472 additions and 54 deletions

View File

@@ -61,7 +61,24 @@ deployment/
## Getting Started
### Prerequisites
### 🚀 Quick Start: Code deployen
**Einfachste Methode:**
```bash
git add .
git commit -m "feat: Add new feature"
git push origin main # → Automatisches Deployment!
```
**Pipeline-Status:** `https://git.michaelschiemer.de/michael/michaelschiemer/actions`
**📖 Vollständige Anleitung:** Siehe [QUICK_START.md](QUICK_START.md) oder [CODE_CHANGE_WORKFLOW.md](CODE_CHANGE_WORKFLOW.md)
---
### Initial Setup (nur bei erstem Setup)
**Prerequisites:**
**Production Server:**
- Docker & Docker Compose installed
@@ -74,28 +91,21 @@ deployment/
- Ansible installed
- SSH key configured for production server
### Initial Setup
**Deployment via Ansible:**
```bash
cd deployment/ansible
ansible-playbook -i inventory/production.yml playbooks/setup-infrastructure.yml
```
1. **Deploy Infrastructure Stacks (Production)**
```bash
cd deployment/stacks/traefik && docker compose up -d
cd ../postgres && docker compose up -d
cd ../registry && docker compose up -d
cd ../gitea && docker compose up -d
cd ../monitoring && docker compose up -d
```
Dieses Playbook deployed alle Stacks:
- Traefik (Reverse Proxy & SSL)
- PostgreSQL (Database)
- Docker Registry (Private Registry)
- Gitea (Git Server)
- Monitoring (Portainer, Grafana, Prometheus)
- **Application Stack** (PHP Application + Nginx + Redis + Queue Workers)
2. **Setup Gitea Runner (Development)**
```bash
cd deployment/runner
docker compose up -d
```
3. **Deploy Application**
```bash
cd deployment/ansible
ansible-playbook -i inventory/production.yml playbooks/deploy-application.yml
```
**📖 Vollständige Setup-Anleitung:** Siehe [SETUP-GUIDE.md](SETUP-GUIDE.md)
## Stack Documentation
@@ -158,10 +168,13 @@ git push origin main
- Pipeline status: `https://git.michaelschiemer.de/michael/michaelschiemer/actions`
- Application status: `ssh deploy@94.16.110.151 "cd ~/deployment/stacks/application && docker compose ps"`
**📖 Detailed Documentation:**
- **[Code Change Workflow](CODE_CHANGE_WORKFLOW.md)** - Complete guide for pushing code changes
- **[Application Stack Deployment](APPLICATION_STACK_DEPLOYMENT.md)** - How deployment works in detail
- **[CI/CD Status](CI_CD_STATUS.md)** - Current CI/CD pipeline status
**📖 Vollständige Dokumentation:**
- **[QUICK_START.md](QUICK_START.md)** - Schnellstart-Guide für Deployment
- **[CODE_CHANGE_WORKFLOW.md](CODE_CHANGE_WORKFLOW.md)** - Kompletter Guide für Codeänderungen
- **[APPLICATION_STACK_DEPLOYMENT.md](APPLICATION_STACK_DEPLOYMENT.md)** - Detaillierter Deployment-Ablauf
- **[CI_CD_STATUS.md](CI_CD_STATUS.md)** - CI/CD Pipeline Status & Checkliste
- **[DEPLOYMENT_SUMMARY.md](DEPLOYMENT_SUMMARY.md)** - Projekt-Status Übersicht
### Pipeline Details
@@ -228,12 +241,23 @@ docker compose -f stacks/application/docker-compose.yml logs -f app-php
docker compose -f stacks/traefik/docker-compose.yml logs -f
```
## 📚 Dokumentation Index
**Vollständige Dokumentations-Übersicht:** Siehe [DOCUMENTATION_INDEX.md](DOCUMENTATION_INDEX.md)
**Wichtigste Dokumente:**
- **[QUICK_START.md](QUICK_START.md)** ⭐ - Schnellstart
- **[CODE_CHANGE_WORKFLOW.md](CODE_CHANGE_WORKFLOW.md)** - Code deployen
- **[APPLICATION_STACK_DEPLOYMENT.md](APPLICATION_STACK_DEPLOYMENT.md)** - Deployment-Details
- **[CI_CD_STATUS.md](CI_CD_STATUS.md)** - CI/CD Status
- **[DEPLOYMENT_SUMMARY.md](DEPLOYMENT_SUMMARY.md)** - Projekt-Übersicht
## Support
For issues and questions, see:
- [Troubleshooting Guide](docs/troubleshooting.md)
- [FAQ](docs/faq.md)
- [Migration Guide](docs/migration.md)
- [Workflow Troubleshooting](WORKFLOW-TROUBLESHOOTING.md)
- [CI/CD Status](CI_CD_STATUS.md) - Mit Troubleshooting-Section
## Migration from Docker Swarm