laravel - 使用 Docker Compose 部署 Laravel 网站时出错
问题描述
我尝试使用 docker-compose( docker-compose.yml ) 部署我的 Laravel 网站,一旦我运行我的 compose 文件,网站就会引发错误
could not find driver (SQL: select * from ...)
我浏览了很多文章,但找不到解决问题的方法。任何人都可以帮忙清楚吗
Docker Compose 版本:3.2 Docker 引擎版本:19.*
这是我的docker-compose.yml
文件:
version: '3.2'
services:
wserver:
image: nginx:latest
container_name: web-nginx
ports:
- 4080:80
volumes:
- type: bind
source: /root/website/files
target: /var/www/html
- type: bind
source: /root/website/nginx/conf.d/
target: /etc/nginx/conf.d/
phpweb:
build:
context: ./php/
container_name: web-phpfpm
ports:
- 4900:9000
volumes:
- type: bind
source: /root/website/files
target: /var/www/html
dbserver:
image: mariadb:latest
container_name: web-mariadb
ports:
- 4306:3306
volumes:
- type: bind
source: /root/website/mariadb/
target: /var/lib/mysql/
- type: bind
source: /root/website/mysql/mariadb.conf.d/
target: /etc/mysql/mariadb.conf.d/
environment:
TZ: "Asia/Kolkata"
MYSQL_ROOT_PASSWORD: password
SERVICE_TAGS: dev
SERVICE_NAME: mysql
Docker File:
FROM php:7.4-fpm
RUN docker-php-ext-install mysqli
解决方案
推荐阅读
- elasticsearch - 如何在 Filebeat 上使用 drop_event
- amazon-web-services - AWS V3 教程 - 创建和使用 Lambda 函数
- python - 在 python 中使用 Twitter 的 API 的 HTTP 错误 405
- dictionary - 关于修改 PyDictKeyEntry
- c# - 如何将小数除以固定位数,四舍五入?
- python - 试图查看一列是否等于另一列
- yaml - 如何将环境变量值添加到 YAML 文件?
- c# - 如何使用 c# 提取 .img 文件
- javascript - 有谁知道为什么我的
离上面的线那么远吗?
- c# - 在 Global.asax Application_EndRequest 函数中获取响应内容长度?