docker shit
This commit is contained in:
78
README.md
78
README.md
@@ -4,6 +4,7 @@
|
||||
[](https://tailwindcss.com/)
|
||||
[](https://www.typescriptlang.org/)
|
||||
[](https://www.electronjs.org/)
|
||||
[](https://www.docker.com/)
|
||||
[](LICENSE)
|
||||
|
||||
A modern, cross-platform blog system built with **Next.js**, **Markdown**, and **Electron**. Write posts in Markdown, manage content visually, and deploy to web or desktop.
|
||||
@@ -18,6 +19,7 @@ A modern, cross-platform blog system built with **Next.js**, **Markdown**, and *
|
||||
- 🖥️ **Electron desktop app** — Run your blog as a native desktop app
|
||||
- 📱 **Responsive UI** — Mobile-friendly and clean design
|
||||
- 🛠️ **Admin dashboard** — Manage posts and folders visually
|
||||
- 🐳 **Docker support** — Easy deployment with Docker containers
|
||||
|
||||
---
|
||||
|
||||
@@ -27,6 +29,7 @@ A modern, cross-platform blog system built with **Next.js**, **Markdown**, and *
|
||||
|
||||
- [Node.js 18+](https://nodejs.org/)
|
||||
- [npm](https://www.npmjs.com/)
|
||||
- [Docker](https://www.docker.com/) (for containerized deployment)
|
||||
|
||||
### Installation
|
||||
|
||||
@@ -52,6 +55,70 @@ npm install
|
||||
|
||||
---
|
||||
|
||||
## 🐳 Docker Deployment
|
||||
|
||||
The project includes Docker support for easy deployment. A `manage_container.sh` script is provided to simplify container management.
|
||||
|
||||
### Docker Setup
|
||||
|
||||
1. Make sure Docker is installed and running on your system
|
||||
2. Update the `MARKDOWN_DIR` path in `manage_container.sh` to point to your local markdown directory
|
||||
3. Make the script executable:
|
||||
```bash
|
||||
chmod +x manage_container.sh
|
||||
```
|
||||
|
||||
### Container Management
|
||||
|
||||
The `manage_container.sh` script provides several commands:
|
||||
|
||||
```bash
|
||||
# Build the Docker image
|
||||
./manage_container.sh build
|
||||
|
||||
# Start the container
|
||||
./manage_container.sh start
|
||||
|
||||
# Stop the container
|
||||
./manage_container.sh stop
|
||||
|
||||
# Restart the container
|
||||
./manage_container.sh restart
|
||||
|
||||
# View container logs
|
||||
./manage_container.sh logs
|
||||
|
||||
# Check container status
|
||||
./manage_container.sh status
|
||||
|
||||
# Remove the container
|
||||
./manage_container.sh remove
|
||||
```
|
||||
|
||||
### Container Features
|
||||
|
||||
- **Health Checks**: Automatic health monitoring
|
||||
- **Auto-restart**: Container restarts automatically if it crashes
|
||||
- **Volume Mounting**: Your markdown files are mounted into the container
|
||||
- **Port Mapping**: Access the blog at http://localhost:8080
|
||||
|
||||
### Container Status
|
||||
|
||||
The status command shows:
|
||||
- Container running state
|
||||
- Health check status
|
||||
- Access URL
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If the container fails to start:
|
||||
1. Check the logs: `./manage_container.sh logs`
|
||||
2. Verify Docker is running
|
||||
3. Ensure port 8080 is available
|
||||
4. Check the markdown directory path in `manage_container.sh`
|
||||
|
||||
---
|
||||
|
||||
## 📝 Writing Posts
|
||||
|
||||
Add Markdown files to the `posts/` directory. Each post should have frontmatter:
|
||||
@@ -79,7 +146,9 @@ markdownblog/
|
||||
│ └── lib/ # Utility functions
|
||||
├── electron/ # Desktop app code
|
||||
├── public/ # Static assets (favicons, etc.)
|
||||
└── ...
|
||||
├── Dockerfile # Docker configuration
|
||||
├── .dockerignore # Docker ignore rules
|
||||
└── manage_container.sh # Docker management script
|
||||
```
|
||||
|
||||
---
|
||||
@@ -99,12 +168,7 @@ Next.js will automatically serve these at the root URL (e.g., `/favicon.ico`).
|
||||
- [Electron](https://www.electronjs.org/)
|
||||
- [Remark](https://remark.js.org/) (Markdown)
|
||||
- [date-fns](https://date-fns.org/)
|
||||
|
||||
---
|
||||
|
||||
## 🐳 Docker
|
||||
|
||||
A sample `Dockerfile` and `manage_container.sh` are included for containerized deployment.
|
||||
- [Docker](https://www.docker.com/)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user