Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM alpine:3.12
LABEL Maintainer="BlogoText community <>" \
Description="Lightweight container (Nginx / PHP-FPM / Alpine) running BlogoText bloging engine."

# Install packages and remove default server definition
RUN apk --no-cache add php7 php7-fpm php7-opcache php7-mysqli php7-json php7-openssl php7-curl \
php7-zlib php7-xml php7-phar php7-intl php7-dom php7-xmlreader php7-ctype php7-session \
php7-mbstring php7-gd php7-pdo_sqlite php7-pdo_mysql nginx supervisor curl git && \
rm /etc/nginx/conf.d/default.conf

# Configure nginx
COPY ./.docker/config/nginx.conf /etc/nginx/nginx.conf

# Configure PHP-FPM
COPY ./.docker/config/fpm-pool.conf /etc/php7/php-fpm.d/www.conf
COPY ./.docker/config/php.ini /etc/php7/conf.d/custom.ini

# Configure supervisord
COPY ./.docker/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Setup document root
RUN mkdir -p /var/www/html

# Add application file
COPY ./ /var/www/html/

# Make sure files/folders needed by the processes are accessable when they run under the www-data user
RUN chown -R nobody.nobody /var/www/html && \
chown -R nobody.nobody /run && \
chown -R nobody.nobody /var/lib/nginx && \
chown -R nobody.nobody /var/log/nginx

# Switch to use a non-root user from here on
USER nobody

# Add application
WORKDIR /var/www/html

VOLUME /var/www/html

# Expose the port nginx is reachable on
EXPOSE 8080

# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ This is BlogoText, the lightweight SQLite Blog-Engine.
* [mbstring](http://php.net/manual/book.mbstring.php)

## Installation
### Self-hosted
* Download [the lastest release](https://github.com/BlogoText/blogotext/releases)
* Upload folder to your site (eg: to `https://example.com/blog`)
* Use your browser to go to your site
* Follow the few steps

### Docker
* Intall [Docker](https://docs.docker.com/engine/install/)
* Install [docker-compose](https://docs.docker.com/compose/install/)
* Checkout git repository: `git clone https://github.com/BlogoText/blogotext.git`
* Build docker image and run BlogoText container at once: `docker-compose up -d --build`
* Access BlogoText @ https://YOUR_IP_ADRESS:8080
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '2.4'

volumes:
bgt-data:

services:
blogotext:
image: blogotext
container_name: blogotext
build:
context: ./
volumes:
- bgt-data:/var/www/html
ports:
- 8080:8080
restart: unless-stopped
2 changes: 1 addition & 1 deletion inc/conv.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function markup_clean_href($matches)
!filter_var($matches['2'], FILTER_VALIDATE_URL)
|| !preg_match('#^('.join('|', $allowed).')#i', $matches['2'])
)
&& !preg_match('/^#[\w-_]+$/i', $matches['2']) // allowing [text|#look-at_this]
&& !preg_match('/^#[\w\-_]+$/i', $matches['2']) // allowing [text|#look-at_this]
) {
return $matches['0'];
}
Expand Down