0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

FrankenPHP学習メモ

Posted at

はじめに

FrankenPHP について ChatGPT に大いに助けてもらいながら個人的に手を動かして勉強した時のメモです。今回は AppRun で動かしてみました。

FrankenPHP概要

公式サイト: https://frankenphp.dev/
作者: Kévin Dunglas さん

必要なファイルを用意

Dockerfile

FROM dunglas/frankenphp
COPY Caddyfile /etc/frankenphp/Caddyfile
COPY index.php /app/public/

docker-compose.yml

version: '3'

services:
  frankenphp:
    build: .
    ports:
      - "80:80"

Caddyfile

http://:80 {
    root * /app/public
    php_server
    file_server
}

index.php

<?php
echo "Hello FrankenPHP!";
echo phpinfo();

dockerイメージのビルド

> docker build --platform linux/amd64 -t my-franken .

コンテナレジストリにログイン

> docker login 作成したコンテナレジストリ名.sakuracr.jp

イメージタグを作成

> docker tag my-franken 作成したコンテナレジストリ名.sakuracr.jp/my-franken:latest

ビルドしたdockerイメージをプッシュ

> docker push 作成したコンテナレジストリ名.sakuracr.jp/my-franken:latest

「アプリケーション作成」をクリック

image.png

アプリケーションの設定項目(主なもの)

ポート: 80
アプリケーション名: my-franken
コンテナイメージ: 作成したコンテナレジストリ名.sakuracr.jp/my-franken:latest
コンテナレジストリアクセス設定: (設定したIDとパスワードを入力)

「作成する」をクリック

ステータスが「正常」になることを確認する
image.png

「公開URL」にアクセスする

image.png
動きました。

次の課題

  • WordPress も動かせるかな・・・と思いましたが、私には荷が重かったようで、うまくいきませんでした。。。
  • 一見セットアップできたように見えても、記事リストが表示されないなど動作がおかしい
  • いつかリベンジしたい
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?