I dockerised my project symfony it works well. I run command sudo docker-compose run php bin/console doctrine:schema:update --force.
And I have this error : An exception occurred in driver: could not find driver
docker-compose.yml
eversion: '2'
services:
nginx:
build: nginx
ports:
- "8080:80"
links:
- php
volumes_from:
- php
volumes:
- ./logs/nginx/:/var/log/nginx
- ./symfony:/var/www/symfony
db:
image: mysql
ports:
- 3307:3307
volumes:
- "./.data/db:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: nolan
MYSQL_USER: nolan
MYSQL_PASSWORD: nolan
ports:
- "8002:3307"
php:
build: php7-fpm
ports:
- 9002:9000
links:
- db:mysql
volumes:
- ./symfony:/var/www/symfony
- ./logs/symfony:/var/www/symfony/app/logs
.env symfony
DATABASE_URL=mysql://nolan:[email protected]:8002/musiques
DATABASE_URL=mysql://nolan:nolan@db:3307/musiques.@dbreferences the db-service from your docker-compose.yml. The port8002is the one being exposed to your host system, but is not the one used between the containers3306though. So it might be that there is nothing running on the port you are exposing?could not find drivercould hint at a missingpdo_mysqldriver. Could you also add your Dockerfile for the php container to the question?