2026-03-03 20:11:17 +00:00
2026-03-03 20:11:17 +00:00

Rust Blog CMS

A simple blog CMS built with Rust, Axum, Askama, and SQLite.

Prerequisites

Configuration

  1. Copy the .env.example file to create your local .env file:

    cp .env.example .env
    
  2. Open the .env file and set your environment variables:

    • PORT: The port your server will listen on (default is 3000).
    • DATABASE_URL: The connection string for your SQLite database (default is sqlite://data.db).

Database Setup

If you are using the sqlx CLI, you can create the database with:

cargo install sqlx-cli --no-default-features --features rustls,sqlite
sqlx database create

(Optionally run migrations if any exist: sqlx migrate run)

Running the app

To start the server, simply run:

cargo run

Then, open your web browser and navigate to http://localhost:3000 (or whichever port you configured).

Run with Docker

You can also run this project using Docker.

To start the application and its dependencies (like the database and attachment storage):

docker-compose up -d --build

The application will be accessible at http://localhost:3000. Persistent data (the database and attachments) will be stored in the local directory.

Using Docker Directly

  1. Build the image:

    docker build -t blog-cms .
    
  2. Run the container:

    docker run -d \
      -p 3000:3000 \
      -v $(pwd)/data.db:/app/data.db \
      -v $(pwd)/attachments:/app/attachments \
      --name blog-cms \
      blog-cms
    
Description
No description provided
Readme 88 KiB
Languages
Rust 74.3%
HTML 21.1%
Dockerfile 4.6%