Use CMS called Pico to write articles in Markdown with docker. The configuration is as follows.
│ ├─filters
├─nginx
│ ├─Dockerfile
│ └─conf/nginx.conf
├─php
│ ├─Dockerfile
│ └─php.ini
└─src
docker-compose.yml
docker-compose.yml
version: '3'
services:
php:
build:
context: ./php
args:
TZ: $TZ
volumes:
- ./src:/var/www/html/
- ./php/php.ini:/usr/local/etc/php/conf.d/php.ini
nginx:
build:
context: ./nginx
args:
TZ: $TZ
ports:
- "80:80"
volumes:
- ./nginx/conf:/etc/nginx/conf.d
- ./src:/var/www/html/
depends_on:
- php
PHP
php/Dockerfile
FROM php:8.0-fpm
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
apt-utils \
zip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
# Timezone
ARG TZ
RUN apt-get install -y tzdata && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \
echo ${TZ} > /etc/timezone
# Composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
# coofiguration
COPY php.ini /usr/local/etc/php/
php/php.ini
date.timezone = "Asia/Tokyo"
Nginx
nginx/Dockerfile
FROM nginx:1.19.6
ADD conf /etc/nginx/conf.d
ARG TZ
ENV TZ ${TZ}
RUN apt-get install -y tzdata && \
echo "${TZ}" > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stdout /var/log/nginx/error.log
nginx/conf/nginx.conf
server {
listen 80;
server_name _;
root /var/www/html/pico;
index index.php index.html;
location ~ ^/((config|content|vendor|composer\.(json|lock|phar))(/|$)|(.+/)?\.(?!well-known(/|$))) {
try_files /index.php$is_args$args =404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# Let Pico know about available URL rewriting
fastcgi_param PICO_URL_REWRITING 1;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
}
Keep the repository used for Github.
https://github.com/daikidomon/pico-docker
By the way, I thought I would use Pico, but I didn't use it this time because I want Grav to be better (Tepepero).
Recommended Posts