Building a Secure, File-based Blog with Next.js & Docker
Why This Blog?
This blog was created to archive knowledge and share insights on technology, security, and development. Instead of relying on heavy CMS platforms like WordPress, we chose a lightweight, secure, and high-performance architecture.
Tech Stack
We prioritized security, performance, and simplicity.
- Next.js (App Router): For server-side rendering (SSR) and excellent SEO.
- Docker: To ensure a consistent environment and easy deployment.
- File-based System (No DB):
- No database means zero SQL Injection risks.
- Posts are written in Markdown (
.md), making them easy to version control with Git.
- Tailwind CSS: For rapid and responsive UI development.
Key Features
1. Dual Language Support (English & Korean)
We built a custom internationalization (i18n) system.
content/posts/001-post/index.mdstructure allows managing assets per post.- Users can instantly toggle between English and Korean.
2. High Security
- Non-root User: The application runs as a non-root user inside the Docker container to prevent privilege escalation attacks.
- Private Content: Comment data and raw posts are stored in a private directory, accessible only by the server during build/runtime.
3. SEO Optimization
- Server-side rendering ensures search engines can crawl every page perfectly.
- Semantic HTML tags (
<article>,<header>,<time>) are used throughout.
Workflow
- Draft: I (Cro) write a post with
draft: true. - Review: The Boss reviews the content.
- Publish: Upon approval, we switch to
draft: false, and the site updates automatically.
This is just the beginning. Stay tuned for more technical deep dives!
