{"id":399,"date":"2024-04-29T23:13:22","date_gmt":"2024-04-29T14:13:22","guid":{"rendered":"https:\/\/txn.myds.me\/blog\/?p=399"},"modified":"2024-04-29T23:13:22","modified_gmt":"2024-04-29T14:13:22","slug":"podman-%e3%81%a7-cakephp5%e3%82%92%e5%8b%95%e3%81%8b%e3%81%99","status":"publish","type":"post","link":"https:\/\/blog.txn.red\/?p=399","title":{"rendered":"podman \u3067 cakephp5\u3092\u52d5\u304b\u3059"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u3060\u3044\u3076\u4f73\u5883\u306b\u5165\u3063\u3066\u304d\u307e\u3057\u305f\u304c podman \u3067 cakephp5 \u3092\u52d5\u304b\u3059\u7d9a\u304d\u3067\u3059\u3002php-fpm \u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u308a\u3001CakePHP5 \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002CaddyServer \u306f\u9577\u304f\u306a\u308b\u306e\u3067\u6b21\u306e\u8a18\u4e8b\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%25e7%259b%25ae%25e7%259a%2584%25e3%2581%25ae%25e6%25a7%258b%25e6%2588%2590\">\u76ee\u7684\u306e\u69cb\u6210<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65e6\u3001\u4eca\u56de podman \u3067\u5efa\u3066\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u3068\u30dd\u30fc\u30c8\u306e\u69cb\u6210\u3092\u8aac\u660e\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CaddyServer \u30db\u30b9\u30c8\u30dd\u30fc\u30c8:8080 >  \u30b3\u30f3\u30c6\u30ca\u30dd\u30fc\u30c8:80<\/li>\n\n\n\n<li>php-fpm  \u30db\u30b9\u30c8\u30dd\u30fc\u30c8:- >  \u30b3\u30f3\u30c6\u30ca\u30dd\u30fc\u30c8:9000<\/li>\n\n\n\n<li>MariaDB \u30db\u30b9\u30c8\u30dd\u30fc\u30c8:3306 >  \u30b3\u30f3\u30c6\u30ca\u30dd\u30fc\u30c8:3306<\/li>\n\n\n\n<li>.\/html \u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a CaddyServer \u3068 php-fpm \u304b\u3089\u305d\u308c\u305e\u308c\u30ea\u30f3\u30af\u3059\u308b<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6765\u306a\u3089 MariaDB \u306e\u30dd\u30fc\u30c8\u306f\u3001php-fpm \u304b\u3089\u3057\u304b\u30a2\u30af\u30bb\u30b9\u3057\u306a\u3044\u306e\u3067\u30db\u30b9\u30c8\u5074\u306b\u9732\u51fa\u3057\u306a\u304f\u3066\u826f\u3044\u306e\u3067\u3059\u304c\u3001\u30db\u30b9\u30c8\u5074\u304b\u3089\u89e6\u308c\u305f\u307b\u3046\u304c\u4fbf\u5229\u306a\u306e\u3067\u4fbf\u5b9c\u4e0a\u958b\u3051\u3066\u307e\u3059\u3002\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30b5\u30fc\u30d0\u306b\u5efa\u3066\u308b\u969b\u306f\u958b\u3051\u306a\u3044\u307b\u3046\u304c\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Caddy \u3068 php-fpm \u30b3\u30f3\u30c6\u30ca\u306f\u5206\u3051\u306a\u304f\u3066\u3082\u3044\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u4eca\u56de\u306f\u5206\u3051\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">php-fpm \u306e\u8a2d\u5b9a\u306f\u3061\u3087\u3063\u3068\u9762\u5012\u306a\u306e\u3067\u3061\u3083\u3093\u3068\u624b\u9806\u3092\u8ffd\u3063\u3066\u793a\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%25e6%2589%258b%25e9%25a0%2586\">\u624b\u9806<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"phpfpm-%25e3%2582%25b3%25e3%2583%25b3%25e3%2583%2586%25e3%2583%258a\">php-fpm \u30b3\u30f3\u30c6\u30ca<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"phpfpm-%25e3%2582%25a4%25e3%2583%25a1%25e3%2583%25bc%25e3%2582%25b8%25e3%2581%25ae%25e3%2583%2593%25e3%2583%25ab%25e3%2583%2589\">php-fpm \u30a4\u30e1\u30fc\u30b8\u306e\u30d3\u30eb\u30c9<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">php \u306e\u30b3\u30f3\u30c6\u30ca\u306f\u30a4\u30e1\u30fc\u30b8\u6301\u3063\u3066\u304f\u308b\u3060\u3051\u3067\u306f\u6e08\u307e\u306a\u3044\u306e\u3067 Dockerfile \u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>FROM php:8.3-fpm-bookworm\nLABEL MAINTAINER=&quot;mnishi&quot;\nARG UID=1000\nARG GID=1000\n\nRUN apt-get update && \\\n    apt-get install -y git zip unzip vim libonig-dev libxml2-dev wget && \\\n    docker-php-ext-install intl pdo_mysql bcmath mbstring simplexml\nRUN wget https:\/\/getcomposer.org\/installer -O composer-installer.php && \\\n    php composer-installer.php --filename=composer --install-dir=\/usr\/local\/bin && \\\n    composer self-update\n\nRUN usermod  -u $UID www-data && \\\n    groupmod -g $GID www-data\n\nWORKDIR \/var\/www<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a4\u30e1\u30fc\u30b8\u306f\u3001Debian \u306e\u65b9\u304c\u307e\u3060\u6163\u308c\u3066\u3044\u308b\u306e\u3067 8.3-fpm-bookworm \u3068\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">apt-get \u3067\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307e\u3059\u304c\u3001vim \u306f\u5b8c\u5168\u306a\u597d\u307f\u306a\u306e\u3067\u5165\u308c\u306a\u304f\u3066\u3044\u3044\u3067\u3059\u3002wget \u3082\u4e0d\u8981\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker-php-ext-install \u3067 CakePHP \u306b\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/usr\/local\/bin \u306b composer \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ARG UID= \u3068ARG GID= \u306f\u3001\u30db\u30b9\u30c8\u5074\u306e\u5b9f\u884c\u30e6\u30fc\u30b6\u30fc\u306e uid\u3001gid \u3092\u6e21\u3059\u305f\u3081\u306e\u74b0\u5883\u5909\u6570\u3067\u3059\u3002\u3082\u3057\u304b\u3059\u308b\u3068\u521d\u671f\u5024\u306f\u3044\u3089\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">php-fpm \u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d3\u30eb\u30c9\u3059\u308b\u524d\u306b www-data \u30e6\u30fc\u30b6\u3092\u30db\u30b9\u30c8\u306b\u4f5c\u3063\u3066\u304a\u304d\u3001\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u3082\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$ useradd -M www-data\n$ usermod -aG www-data [\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc]<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002Dockerfile \u3068\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$ buildah bud --build-arg UID=$(id -u www-data) --build-arg GID=$(id -g www-data) --tag my-php . <\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65e6\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3066\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092 php-fpm \u30d5\u30a9\u30eb\u30c0\u306b\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002\uff08\u30d5\u30a9\u30eb\u30c0\u540d\u306f\u306a\u3093\u3067\u3082\u3044\u3044\u3067\u3059\u3002\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$ mkdir php-fpm\n$ podman run --name tmp-php -d localhost\/my-php\n$ podman cp tmp-php:\/usr\/local\/etc\/php\/php.ini-production .\/php-fpm\n$ podman cp tmp-php:\/usr\/local\/etc\/php\/php.ini-development .\/php-fpm\n$ podman cp tmp-php:\/usr\/local\/etc\/php\/php-fpm.conf .\/php-fpm\n$ podman rm -f tmp-php<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u308f\u306a\u3044\u304b\u3082(\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u306a\u3044\u304b\u3082)\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u4e00\u5fdc php.ini \u3068 php-fpm.conf \u3092\u53d6\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53d6\u3063\u3066\u304d\u305f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>podman run -d --name php \\\n    -v .\/php-fpm\/php\/php-fpm.conf:\/usr\/local\/etc\/php\/php-fpm.conf \\\n    -v .\/php-fpm\/php\/php.ini-development:\/usr\/local\/etc\/php\/php.ini \\\n    -v .\/html:\/usr\/share\/caddy \\\n    my-php<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8d77\u52d5\u306b\u5931\u6557\u3059\u308b\u3088\u3046\u3067\u3057\u305f\u3089\u3001-d \u3092\u5916\u3057\u3066\u30a8\u30e9\u30fc\u3092\u773a\u3081\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">php-fpm \u30b3\u30f3\u30c6\u30ca\u5185\u3067 CakePHP \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067\u5168\u3066\u304c\u3046\u307e\u304f\u884c\u3063\u3066\u3044\u308c\u3070\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u4e2d\u306b\u5165\u3063\u3066 composer \u3067 CakePHP \u3092\u30c7\u30d7\u30ed\u30a4\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>; \u30db\u30b9\u30c8\u5074\u304b\u3089\n$ podman exec -it caddy-pod-php \/bin\/bash \n\n ; \u30b3\u30f3\u30c6\u30ca\u306e\u4e2d\u306b\u5165\u3063\u305f\n# cd \/usr\/share\/caddy\n# composer create-project --prefer-dist cakephp\/app:&quot;5.*&quot; app\nDo not run Composer as root\/super user! See https:\/\/getcomposer.org\/root for details\nContinue as root\/super user [yes]? yes\n; root  \u3067\u52d5\u304b\u3057\u3066\u3044\u308b\u3088\u3068\u6012\u3089\u308c\u308b\u304c\u7121\u8996\u3059\u308b\n\n.... \u3044\u308d\u3044\u308d\u30ed\u30b0\u304c\u6d41\u308c\u308b\n\nSet Folder Permissions ? (Default to Y) [Y,n]? y\nPermissions set on \/usr\/share\/caddy\/app\/tmp\/cache\nPermissions set on \/usr\/share\/caddy\/app\/tmp\/cache\/models\nPermissions set on \/usr\/share\/caddy\/app\/tmp\/cache\/persistent\nPermissions set on \/usr\/share\/caddy\/app\/tmp\/cache\/views\nPermissions set on \/usr\/share\/caddy\/app\/tmp\/sessions\nPermissions set on \/usr\/share\/caddy\/app\/tmp\/tests\nPermissions set on \/usr\/share\/caddy\/app\/tmp\nPermissions set on \/usr\/share\/caddy\/app\/logs\nUpdated Security.salt value in config\/app_local.php<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d41\u884c\u308a\u306e\u30eb\u30fc\u30c8\u30ec\u30b9\u69cb\u6210\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u6012\u3089\u308c\u307e\u3059\u304c\u3072\u3068\u307e\u305a\u305d\u306e\u307e\u307e\u884c\u304d\u307e\u3059\u3002\uff08\u6163\u308c\u305f\u6240\u3067\u3082\u3046\u4e00\u5ea6\u30eb\u30fc\u30c8\u30ec\u30b9\u69cb\u6210\u3092\u3084\u3063\u3066\u307f\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CakePHP \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067 php \u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u4e0d\u8db3\u3057\u3066\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408\u306f\u3001exec \u3067\u30b3\u30f3\u30c6\u30ca\u5185\u306b\u5165\u308a docker-php-ext-install \u3067\u4e0d\u8db3\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066 composer \u304c\u52d5\u4f5c\u3059\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<br>\u3046\u307e\u304f\u884c\u3063\u305f\u3089\u3001Docker \u30d5\u30a1\u30a4\u30eb\u306b\u4e0d\u8db3\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u3057\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u30a4\u30e1\u30fc\u30b8\u306e\u30d3\u30eb\u30c9\u304b\u3089\u3084\u308a\u76f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%25e5%258f%2582%25e8%2580%2583\">\u53c2\u8003<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.zu-min.com\/archives\/595\">podman \u3067 nginx + php + mariadb \u3092\u7acb\u3061\u4e0a\u3052\u3066\u307f\u308b | zu-min.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3060\u3044\u3076\u4f73\u5883\u306b\u5165\u3063\u3066\u304d\u307e\u3057\u305f\u304c podman \u3067 cakephp5 \u3092\u52d5\u304b\u3059\u7d9a\u304d\u3067\u3059\u3002php-fpm \u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u308a\u3001CakePHP5 \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002CaddyServer \u306f\u9577\u304f\u306a\u308b\u306e\u3067\u6b21\u306e\u8a18\u4e8b\u306b\u3057\u307e\u3059\u3002 \u76ee\u7684\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[5],"tags":[15,16],"class_list":["post-399","post","type-post","status-publish","format-standard","hentry","category-it","tag-cakephp","tag-podman"],"_links":{"self":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=399"}],"version-history":[{"count":0,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}