Run Pico with docker

Purpose of this article

Use CMS called Pico to write articles in Markdown with docker. The configuration is as follows.

Source

                │  ├─filters

Directory structure

├─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;
	}
}

Repository

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

Run Pico with docker
Run Payara with Docker
Run TAO Core with Docker
Run Rails whenever with docker
Run lambda with custom docker image
Run SQL Server with Docker ToolBox
Make JupyterLab run anywhere with docker
Run Ubuntu + ROS with Docker on Mac
How to run Blazor (C #) with Docker
Launch MariaDB with Docker
Rails deploy with Docker
Explode Docker with WSL2
Use Puphpeteer with Docker
Run JSP Hello World with Tomcat on Docker
Operate Emby with Docker
Try WildFly with Docker
Create jupyter notebook with Docker and run ruby
Use ngrok with Docker
[Docker] Connection with MySQL
Php settings with Docker
Getting Started with Docker
Disposable PHP with Docker
Install Composer with Docker
Run phpunit on Docker
Run old Vivado with Docker guest OS as CentOS 7.4
Run Android instrumentation unit tests with GitLab CI + Docker
Run Mosquitto with Docker and try WebSocket communication with MQTT
Pytorch execution environment with Docker
What is docker run -it?
Use GDAL with Python with Docker
Run batch with docker-compose with Java batch
Run VS Code on Docker
Deploy with EC2 / Docker / Laravel
Docker management with VS Code
Set up GitLab with docker
Run Tensorflow with THETA V
Run LIFF with Spring Boot
Decomposing the Docker run command. .. ..
Get started with DynamoDB with docker
Docker autostart settings with wsl2
[Docker] Rails 5.2 environment construction with docker
Spring Boot starting with Docker
Build docker environment with WSL
Version control CocoaPods with Docker
Web application built with docker (1)
I tried BIND with Docker
React environment construction with Docker
Build DynamoDB local with Docker
Run Java VM with WebAssembly
[Docker] Use whenever with Docker + Rails
Using PlantUml with Honkit [Docker]
Write DiscordBot to Spreadsheets Write in Ruby and run with Docker
Rails + MySQL environment construction with Docker
Create a Vue3 environment with Docker!
Node.js environment construction with Docker Compose
Deploy a Docker application with Greengrass
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Steps to run docker on Mac
Environment construction with Docker for beginners
Run puppeteer-core on Heroku (Docker edition)