From 0cf84ffe0e111647b9c4eea109a30333a62c3982 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Tue, 5 Aug 2025 22:48:21 +0200 Subject: [PATCH] feat: change ports Signed-off-by: kjuulh --- README.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ ci/src/main.rs | 2 +- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e17341d --- /dev/null +++ b/README.md @@ -0,0 +1,84 @@ +# Kasper Hermansen's Blog + +A personal blog built with Zola (static site generator) and deployed using containerized CI/CD with Dagger. + +## Prerequisites + +- **mise** - Development environment manager +- **Rust** - For running Dagger CI +- **Docker** - For containerization + +## Development + +### Quick Start + +```bash +# Install dependencies and start dev server +mise run dev +``` + +This will: +- Start Zola dev server on http://localhost:1111 +- Watch and compile Tailwind CSS changes +- Show draft posts + +### Available Commands + +```bash +mise run dev # Start development server with live reload +mise run ci:pr # Run CI build for pull requests +mise run ci:main # Run full CI pipeline (build + deploy) +``` + +## Deployment + +The blog uses a fully automated CI/CD pipeline built with Dagger (Rust SDK). + +### Manual Deployment + +```bash +# Build and deploy to production +(cd ci && cargo build) +./ci/target/debug/ci main +``` + +This will: +1. Compile Tailwind CSS styles +2. Build static site with Zola +3. Package with Caddy web server +4. Push Docker image to registry +5. Update deployment configuration in git + +### Automated Deployment + +Pushing to `main` branch triggers automatic deployment via CI. + +## Project Structure + +``` +├── content/posts/ # Blog posts (Markdown with YAML frontmatter) +├── templates/ # Zola templates (Tera) +├── static/ # Static assets +├── styles/ # Tailwind CSS source +├── ci/ # Dagger CI/CD pipeline (Rust) +├── deployment/ # Caddy server configuration +├── config.toml # Zola configuration +└── mise.toml # Development tasks +``` + +## Adding Content + +Create a new post in `content/posts/`: + +```markdown ++++ +title = "Your Post Title" +description = "Brief description" +date = 2025-01-01 +draft = false +[taxonomies] +tags = ["rust", "development"] ++++ + +Your content here... +``` diff --git a/ci/src/main.rs b/ci/src/main.rs index 0eafc88..9c01574 100644 --- a/ci/src/main.rs +++ b/ci/src/main.rs @@ -25,7 +25,7 @@ impl BlogComponent { .up_opts( ServiceUpOptsBuilder::default() .ports(vec![PortForward { - backend: 8000, + backend: 80, frontend: 8000, protocol: dagger_sdk::NetworkProtocol::Tcp, }])