So after trying many things it appears the app.docker file isn’t running the RUN command correctly as the pdo driver isn’t installed. How do I cure this?
I have a site in a docker-compose file. This was working fine until Docker updated today.
When I try and view the site in the browser (http://127.0.0.1:8080/) Laravel throws the error
IlluminateDatabaseQueryException could not find driver (SQL: select * from `CMSPages` where `PageSlug` = Homepage limit 1) http://127.0.0.1:8080/
However, from the localhost I can run a migrate and seed and it connects with no issues. I can connect to the DB from heidi on the host as well, I have connected to the PHP instance, tried a php tinker and it also can connect to the DB and get data back.
So why can I not access the DB from the browser?
version: '2' services: nginx: image: nginx:1.13.12 ports: - "8443:443" - "8080:80" volumes: - ./:/var/www - ./docker/nginxconf:/etc/nginx/conf.d - ./docker/ssl-cert:/etc/nginx/certs working_dir: /var/www links: - php php: build: context: ./ dockerfile: docker/app.docker volumes: - ./:/var/www depends_on: - db links: - db environment: - "DB_PORT=3306" - "DB_HOST=db" db: image: mariadb environment: - "MYSQL_ROOT_PASSWORD=removed" - "MYSQL_DATABASE=removed" ports: - "33061:3306"
FROM php:7-fpm RUN apt-get update RUN apt-get install -y libmcrypt-dev mariadb-client RUN apt-get install libmcrypt4 RUN docker-php-ext-install pdo_mysql WORKDIR /var/www