This repo contains the source code for a blog site built with Flask. The blog supports Markdown blogpost creation and future edits, tags, comments, dark mode and a management panel.
Clone this repository, install dependencies, and set environment variables:
$ git clone https://github.com/olirowan/olirowan-blog.git
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ touch .env
Modify the .env to set the following values:
- SQLALCHEMY_DATABASE_URI - Specify a database endpoint (optional, default: SQLite3 file)
- SERVER_NAME - Define which host and port the application is bound to (optional, default: localhost:5000)
Configure the database:
$ flask db upgrade
Run the application from the command line as follows:
$ . ./set_env.sh
$ flask run
The application can be run in a container for quick setup.
If you don't wish to use containers then the configuration from supervisord.conf and nginx-config.conf can be used as a reference to stand up the application as you prefer.
This will create a container running the frontend application however you will still need celery workers running.
docker build -t olirowan/olirowan-blog:v1.0 .
docker run --name olirowan-blog -it \
-e SQLALCHEMY_DATABASE_URI=mysql://demo:demo@db-host:3306/olirowan-blog \
-e SERVER_NAME=blog.example.com
-p 5000:80 -\
olirowan/olirowan-blog:v1.0
You should now be able to access the application at http://localhost:5000/