docker composeでh2oとPHP8.1の環境構築する

割とすんなり設定できてよき。

docker-compose.ymlはこんなかんじ

version: '3.8'

services:
  h2o:
    image: lkwg82/h2o-http2-server:v2.2.6
    volumes:
      - ./h2o/h2o.conf:/home/h2o/h2o.conf
    volumes_from:
      - phpfpm
    ports:
      - "38084:80"
    restart: always
  phpfpm:
    image: php:8.1.6-fpm-buster
    volumes:
      - ./:/var/www/html
    restart: always

h2o.confこのような感じ

file.custom-handler:
  extension: .php
  fastcgi.connect:
    host: phpfpm
    port: 9000
    type: tcp
file.index:
  ["index.php", "index.html"]
hosts:
  "localhost":
    listen:
      port: 80
    paths:
      "/":
        file.dir: /var/www/html

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です