容器化部署laravel框架的PHP项目 操作步骤 参考: https://www.cnblogs.com/jingjingxyk/p/16842937.htmlHttps://develop
参考:
server { listen 80; server_name localhost; root /var/www/html/public; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php$is_args$query_string; if (!-e $request_filename){ rewrite ^/(.*)$ /index.php?s=$1 last; } } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { # root /var/www/html/public; # 忽略这个容器php文件 File not found fastcgi_pass php:9000; fastcgi_index index.php; include fastcgi_params; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; }}
docker-composer.yml
version: '3'networks: nginx-php-network:services: WEB: image: nginx:latest ports: - "8081:80" volumes: - ./nginx-config:/etc/nginx/conf.d - ./:/var/www/html depends_on: - php networks: - nginx-php-network restart: always # 指定容器退出后的重启策略为始终重启php: image: webdevops/php-nginx:7.3-alpine # 可替换php-7.3.33-fpm-alpine3.14:v1 ports: - "9000:9000" restart: always networks: - nginx-php-network volumes: - ./:/var/www/html
查看更多 [每周一更]-(第67期):docker-compose 部署php的laravel项目
来源地址:https://blog.csdn.net/hmx224_2014/article/details/133819070
--结束END--
本文标题: [每周一更]-(第67期):docker-compose 部署php的laravel项目
本文链接: https://lsjlt.com/news/440221.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0