Dockerコンテナ上でLaravelを動かしているのですが、Laravelの認証ページが正常に表示されません…
初心者で申し訳ございませんが、どなたかご指摘いただけますと幸いです。
試したこと
コンテナは起動しており、php artisan serveも実行しています。
また、php artisan ui bootstrap --auth を実行後、
npm install && npm run dev も実行しました。
下記はNginxコンテナに入り、npm install を実行した時の様子です。
npmコマンドの実行場所はNginxコンテナの中で間違いないでしょうか、、
hansh@MacBook-Air laradock % docker-compose exec web ash /data # npm install && npm run dev up to date, audited 116 packages in 786ms 19 packages are looking for funding run `npm fund` for details found 0 vulnerabilities > dev > vite Port 3000 is in use, trying another one... Port 3001 is in use, trying another one... vite v2.9.14 dev server running at: > Local: http://localhost:3002/ > Network: use `--host` to expose ready in 595ms. Laravel v9.20.0 > APP_URL: http://localhost
docker-compose.yml
version: '3.9' services: app: build: ./infra/php volumes: - ./src:/data web: image: nginx:1.20-alpine ports: - 8080:80 volumes: - ./src:/data - ./infra/nginx/default.conf:/etc/nginx/conf.d/default.conf working_dir: /data db: build: ./infra/mysql volumes: - db-store:/var/lib/mysql volumes: db-store:
default.conf(Nginxの設定ファイル)
server { listen 80; server_name example.com; root /data/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; index index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ \.php$ { fastcgi_pass app:9000; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.(?!well-known).* { deny all; } }
エラーの状態
使用環境
・Laravel:9.2.0
・PHP:8.1.8
・Nginx-alpine:1.2.0
・node.js : v14.20.0
・npm : 7.17.0
・ホストOS : M1 Mac
回答2件
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。