Sign inSign up

anmalkov/simple-blog

By anmalkov

Updated about 4 years ago

The simplest blog engine written on .net 6

Image
0

10K+

anmalkov/simple-blog repository overview

Quick reference

What is simple-blog?

Simple-blog is a free and open-source simplest blog engine written on .net 6.

You can find more information on https://github.com/anmalkov/simple-blog

How to use this image

Start a simple-blog instance

$ docker run -d -p 8080:80 --name simple-blog anmalkov/simple-blog

Environment Variables

When you start the simple-blog image, you can adjust the initialization of the simple-blog instance by passing one or more environment variables on the docker run command line.

SIMPLEBLOG_ACCESSCODE

This variable set an admin password. This allows you to login to an administrator area, where you can manage the posts, pages, menu, etc. To get there you have to go to /login page and enter the access code that you specified in this environment variable.

The following is an example of using this variable to create a Simple-blog instance and specify your access code.

$ docker run -d -p 8080:80 --name simple-blog -e SIMPLEBLOG_ACCESSCODE=Test1234! anmalkov/simple-blog
APPLICATIONINSIGHTS_CONNECTION_STRING

This variable set a connection string for Azure Application Insights. This allows you to enable full monitoring for your website including client-side monitoring. You can find the connection string on the General tab of your Application Insights resource in Azure Portal or by executing the next Azure CLI command:

$ az monitor app-insights component show --app application-insights-resource-name -g resourcegroup-name --query "connectionString"

The following is an example of using this variable.

$ docker run -d -p 8080:80 --name simple-blog -e APPLICATIONINSIGHTS_CONNECTION_STRING=your-connection-string anmalkov/simple-blog

Where to store data?

Important note: There are several ways to store data used by simple-blog that run in Docker containers including:

  • Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
  • Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.

The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above:

  1. Create a data directory on a suitable volume on your host system, e.g. /my/own/datadir.

  2. Start your simple-blog container like this:

        $ docker run -d -p 8080:80 --name simple-blog -e SIMPLEBLOG_ACCESSCODE=Test1234! -v /my/own/datadir:/app/data anmalkov/simple-blog
    

The -v /my/own/datadir:/app/data part of the command mounts the /my/own/datadir directory from the underlying host system as /app/data inside the container, where Simple-blog by default will write its data files.

License

View license information for the software contained in this image.

Tag summary

Content type

Image

Digest

sha256:7dbb49e54

Size

89.9 MB

Last updated

about 4 years ago

docker pull anmalkov/simple-blog