{"id":2585,"date":"2026-03-20T13:06:21","date_gmt":"2026-03-20T04:06:21","guid":{"rendered":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/?page_id=2585"},"modified":"2026-03-20T14:26:55","modified_gmt":"2026-03-20T05:26:55","slug":"page-2585","status":"publish","type":"page","link":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/page-2585","title":{"rendered":"Laravel\u306e\u958b\u767a\u74b0\u5883\u3092Windows\u4e0a\u306b\u3064\u304f\u308b"},"content":{"rendered":"<p>Laravel\u306fPHP\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002\u30a6\u30a7\u30d6\u4e0a\u306bPHP\u3092\u4f7f\u3063\u3066\u9ad8\u5ea6\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u5fc5\u8981\u306a\u3082\u306e<\/h3>\n<dl>\n<dt>Windows<\/dt>\n<dd>Docker\u3001\u30a8\u30c7\u30a3\u30bf(Visual Studio Code)\u3001\u30d6\u30e9\u30a6\u30b6\u30fc\u3092\u52d5\u304b\u3059\u3002<\/dd>\n<dt>WSL (Windows Subsystem for Linxu)<\/dt>\n<dd>Docker\u3001Node.js\u3092\u52d5\u304b\u3059\u3002<\/dd>\n<dt>Docker Desktop<\/dt>\n<dd>Docker\u3092\u7c21\u5358\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/dd>\n<dt>Node.js<\/dt>\n<dd>Laravel\u304c\u4f7f\u3046Alpine.js\u3068\u304bTailwind\u3068\u304b\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9(HTML\u3001CSS\u3001Javascript)\u306e\u958b\u767a\u3092\u5bb9\u6613\u306b\u3059\u308bVite\u3092\u52d5\u304b\u3059\u3002\n<\/dl>\n<h3>Docker Desktop\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h3>\n<ol>\n<li>WSL\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3044\u308c\u3066\u304a\u304f\u3002<\/li>\n<li><a href=\"https:\/\/www.docker.com\/\">https:\/\/www.docker.com\/<\/a>\u3078\u3044\u3063\u3066\u3001Products &#8211; Docker Desktop\u3078\u3059\u3059\u3093\u3067\u3001 Download Docker Desktop \u3067Windows AMD64\u7248\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/li>\n<li>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u3001Docker Desktop\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001PC\u306e\u518d\u8d77\u52d5\u3092\u6c42\u3081\u3089\u308c\u308b\u3002<\/li>\n<li>Windows\u306e\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u3001\u3082\u3057\u304f\u306f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u4e0a\u306e\u30a2\u30a4\u30b3\u30f3\u304b\u3089\u3001Docker Desktop\u3092\u8d77\u52d5\u3059\u308b\u3002\u521d\u56de\u8d77\u52d5\u6642\u306f\u4f7f\u7528\u8a31\u8afe\u3092\u53d7\u3051\u5165\u308c\u308b(Accept)\u3002\n<li>\u305f\u3076\u3093\u3001\u30ed\u30b0\u30a4\u30f3(\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u4f5c\u6210)\u306f\u5fc5\u8981\u306a\u3044\u3002\u3082\u3061\u308d\u3093\u3001\u767b\u9332\u3057\u3066\u3082\u3088\u3044\u3002\n<\/ol>\n<h3>Node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h3>\n<p>wsl\u306b\u3042\u308bNode.js\u306f\u53e4\u3044\u306e\u3067\u3001\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3059\u308b\u3002\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f<a href='https:\/\/deb.nodesource.com\/'>\u3053\u3061\u3089<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class='console'>\r\n# curl -fsSL https:\/\/deb.nodesource.com\/setup_20.x | sudo -E bash - \r\n# sudo apt install -y nodejs\r\n<\/pre>\n<h2>Hello World<\/h2>\n<p>\u5b9a\u756a\u306e\u52d5\u4f5c\u78ba\u8a8d\u3092\u3059\u308b\u3002<\/p>\n<h3>\u958b\u767a\u74b0\u5883\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/h3>\n<p>WSL\u3092\u8d77\u52d5\u3057\u3001\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bproject_dir\u3092\u3064\u304f\u308b\u3002<br \/>\n\u3082\u3057\u3001WSL\u3092\u8d77\u52d5\u3057\u305f\u3068\u304d\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u304croot@\u306b\u306a\u3063\u3066\u3044\u308b\u306a\u3089\u3001su &#8211; user_name \u3057\u3066\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u306b\u306a\u3063\u3066\u304a\u304f\u3002<\/p>\n<pre class='console'>\r\n$ mkdir project_dir\r\n$ cd project_dir\r\n<\/pre>\n<p>\u5fc5\u8981\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/p>\n<pre class='console'>\r\n$ tree\r\n.\r\n\u251c\u2500\u2500 docker-compose.yaml      \u2190 docker\u306e\u8a2d\u5b9a\r\n\u251c\u2500\u2500 nginx\/\r\n\u2502   \u2514\u2500\u2500 default.conf         \u2190 nginx\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\r\n\u251c\u2500\u2500 php\/\r\n\u2502   \u2514\u2500\u2500 Dockerfile           \u2190 php\u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a\u3002composer\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\r\n\u2514\u2500\u2500 src\/                     \u2190 Laravel \u672c\u4f53\u304c\u7f6e\u304b\u308c\u308b\u3002vendor\u3060\u3051\u30b3\u30f3\u30c6\u30ca\u5185\u306b\u3044\u308c\u308b\u3088\u3046\u306b\u3059\u308b\r\n    \u2514\u2500\u2500 public\/              \u2190 nginx \u306eroot\r\n        \u2514\u2500\u2500 index.php\r\n<\/pre>\n<h3>docker\u30b3\u30f3\u30c6\u30ca\u306e\u69cb\u6210<\/h3>\n<h4>docker-compose.yaml<\/h4>\n<pre class=\"code\">version: \"3.9\"\r\n\r\nservices:\r\n  nginx:\r\n    image: nginx:1.27-alpine\r\n    container_name: app1_nginx\r\n    ports:\r\n      - \"8080:80\"\r\n    volumes:\r\n      - .\/src\/public:\/var\/www\/html\/public:ro\r\n      - .\/nginx\/default.conf:\/etc\/nginx\/conf.d\/default.conf\r\n    depends_on:\r\n      - php\r\n\r\n  php:\r\n    build: .\/php\r\n    container_name: app1_php\r\n    volumes:\r\n      - .\/src:\/var\/www\/html\r\n      - \/var\/www\/html\/vendor\r\n    environment:\r\n      - TZ=Asia\/Tokyo\r\n<\/pre>\n<h4>php\/Dockerfile<\/h4>\n<p>PHP\u306e\u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a\u3002\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"code\">FROM php:8.2-fpm\r\n# Composer \u3092\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u30b3\u30d4\u30fc\r\nCOPY --from=composer:2 \/usr\/bin\/composer \/usr\/bin\/composer\r\n\r\nWORKDIR \/var\/www\/html\r\n<\/pre>\n<h4>nginx\/default.conf<\/h4>\n<p>nginx\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3002<\/p>\n<pre class=\"code\">server {\r\n    listen 80;\r\n    server_name localhost;\r\n\r\n    root \/var\/www\/html\/public;\r\n    index index.php index.html;\r\n\r\n    location \/ {\r\n        try_files $uri $uri\/ \/index.php?$query_string;\r\n    }\r\n\r\n    location ~ \\.php$ {\r\n        include fastcgi_params;\r\n        fastcgi_pass php:9000;\r\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n    }\r\n}\r\n<\/pre>\n<h4>\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5<\/h4>\n<pre class='console'>$ sudo docker composer up -d\r\n<\/pre>\n<h3>\u52d5\u4f5c\u78ba\u8a8d (nginx\u3068PHP)<\/h3>\n<h4>src\/public\/index.php<\/h4>\n<pre class=\"code\">&lt;? php\r\necho \"Hello world\\n\";\r\nphpinfo();\r\n<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u30fc\u3067 <a href='http:\/\/localhost:8080\/'>http:\/\/localhost:8080\/<\/a> \u3092\u958b\u304f<\/p>\n<h2>Laravel\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u52d5\u4f5c\u78ba\u8a8d\u3067\u3064\u304f\u3063\u305fpublic\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4e88\u3081\u524a\u9664\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002<\/p>\n<p>docker compose exec\u306e\u5834\u5408\u306fdocker-compose.yaml\u3067\u8a2d\u5b9a\u3057\u305fservice\u540d\u3092\u6307\u5b9a\u3059\u308b(\u4e0a\u8a18\u306e\u5834\u5408php)\u3002docker exec\u3068\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u3001\u305d\u306e\u5834\u5408\u306fcontainer_name\u3092\u6307\u5b9a\u3059\u308b(\u4e0a\u8a18\u306e\u5834\u5408app1_php)\u3002<\/p>\n<pre class='console'>$ sudo docker compose exec -it php composer create-project laravel\/laravel .\r\n<\/pre>\n<p>\u6700\u5f8c\u306e.\u306flaravel\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u3059\u3002php\u306edocker\u30a4\u30e1\u30fc\u30b8\u3067WORKDIR \/var\/www\/html\u3068\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u3001docker exec\u3092\u3057\u305f\u3068\u304d\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\/var\/www\/html\u3067\u3042\u308a\u3001.\u306f\u3053\u3053\u3092\u6307\u3059\u3002<br \/>\ndocker-compose.yaml\u3067volumes\u306e\u8a2d\u5b9a\u3067\u3001.\/src:\/var\/www\/html\u3068\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u306e\/var\/www\/html\u306f\u30db\u30b9\u30c8\u306e.\/src\u3092\u6307\u3057\u3001docker compose up -d\u304c\/project_dir\u3067\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u3001\/project_dir\/src\u3068\u306a\u308b\u3002<br \/>\n\u7d50\u5c40\u3001laravel\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\/project_dir\/src\u3068\u306a\u308b\u3002<\/p>\n<p>\u3072\u306a\u5f62\u3068\u3057\u3066starter kit (breeze\/livewire)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre class='console'>$ sudo docker compose exec -it php composer require laravel\/breeze --dev\r\n$ sudo docker compose exec -it php php artisan breeze:install livewire\r\n<\/pre>\n<h3>Node.js\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>breeze\u304c\u5fc5\u8981\u3068\u3059\u308bNode.js\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002artisan breeze:install\u306b\u3088\u3063\u3066package.json\u304c\u3064\u304f\u3089\u308c\u3001\u3053\u306e\u5185\u5bb9\u306b\u5f93\u3063\u3066Node.js\u304c\u52d5\u4f5c\u3059\u308b\u3002<\/p>\n<p>Node.js\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30bd\u30d5\u30c8(\u30b3\u30de\u30f3\u30c9)\u304cnpm\u3002<\/p>\n<pre class='console'>\r\n$ cd \/project_dir\/src\r\n# npm install\r\n<\/pre>\n<p>vite\u306a\u3069\u3092\u52d5\u304b\u3059(\u3053\u3053\u304b\u3089\u5148\u306f\u3084\u3063\u3066\u3044\u308b\u610f\u5473\u3092\u3044\u307e\u3044\u3061\u7406\u89e3\u3057\u3066\u3044\u306a\u3044)\u3002<br \/>\nnpm run\u306f\/project_dir\/src\u306b\u3042\u308bpackage.json\u306escript\u3092\u52d5\u304b\u3059\u3068\u3044\u3046\u3053\u3068\u3089\u3057\u3044\u3002<\/p>\n<pre class='console'>\r\n$ npm run dev\r\n<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u30fc\u3067 <a href='http:\/\/localhost:8080\/'>http:\/\/localhost:8080\/<\/a> \u3092\u958b\u304f<\/p>\n<h2>\u958b\u767a\u74b0\u5883\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/h2>\n<h3>git\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210<\/h3>\n<pre class='console'>\r\n$ git init --bare ~\/app.git\r\n<\/pre>\n<h3>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/h3>\n<pre class='console'>\r\n$ cd \/project_dir\r\n$ git add .\r\n$ git commit -m \"Backup dev env\"\r\n$ git push ~\/app.git master\r\n<\/pre>\n<h3>\u65b0\u3057\u3044\u74b0\u5883<\/h3>\n<p>\u5225\u306e\u30d1\u30bd\u30b3\u30f3\u306b\u958b\u767a\u74b0\u5883\u3092\u30af\u30ed\u30fc\u30f3\u3059\u308b\u3002<\/p>\n<pre class='console'>\r\n$ git clone ssh:\/\/git.host\/home\/your_id\/app.git app_dev\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u306fPHP\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002\u30a6\u30a7\u30d6\u4e0a\u306bPHP\u3092\u4f7f\u3063\u3066\u9ad8\u5ea6\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u5fc5\u8981\u306a\u3082\u306e Windows Docker\u3001\u30a8\u30c7\u30a3\u30bf(Visual Studio Code)\u3001\u30d6\u30e9\u30a6\u30b6\u30fc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/2585"}],"collection":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/comments?post=2585"}],"version-history":[{"count":8,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/2585\/revisions"}],"predecessor-version":[{"id":2597,"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/pages\/2585\/revisions\/2597"}],"wp:attachment":[{"href":"http:\/\/biochemistry.isc.chubu.ac.jp\/labo\/suzuki\/wp-json\/wp\/v2\/media?parent=2585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}