Почему возникает ошибка could not find driver при миграции в laravel?

собственно вот docker-compose.yml то что касается php и постргеса
#PHP Service
  app:
    build:
      context: .
      dockerfile: ./docker/php-fpm/Dockerfile
    image: digitalocean.com/php
    container_name: "${DOCKER_PREFIX}-app"
    restart: unless-stopped
    tty: true
    depends_on:
      - db
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    user: "1000:1000"
    volumes:
      - ./app:/var/www
      - ./docker/php-fpm/local.ini:/usr/local/etc/php/conf.d/local.ini
      - ./docker/php-fpm/supervisor-workers.conf:/etc/supervisor/conf.d/supervisor-workers.conf
    networks:
      - app-network
  #PostgersSQL Service
  db:
    image: postgres:12-alpine
    container_name: "${DOCKER_PREFIX}-db"
    #dockerfile: ./docker/postgres/Dockerfile
    volumes:
      - ./docker/postgres/postgres:/var/lib/postgresql/data
      - ./docker/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
    environment:
      - POSTGRES_DB=${DB_DATABASE}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
    ports:
        - "8091:5432"
    networks:
      - app-network
  adminer:
    image: adminer
    restart: always
    container_name: "${DOCKER_PREFIX}-adminer"
    ports:
      - 8090:8080
    networks:
      - app-network
#Docker Networks
networks:
  app-network:
    driver: bridge

настройки nginx не даю
вот Dockerfile для php
FROM php:7.3-fpm

# Set working directory
WORKDIR /var/www

# Install dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    libpng-dev \
    libjpeg62-turbo-dev \
    libfreetype6-dev \
    locales \
    zip \
    jpegoptim optipng pngquant gifsicle \
    vim \
    unzip \
    git \
    libpq-dev\
    curl

RUN apt-get install -y cron && \
	apt-get install -y supervisor

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install extensions
RUN docker-php-ext-install pdo mbstring pgsql
RUN docker-php-ext-configure # -with-pgsql=/usr/local/pgsql\
    && docker-php-ext-install \
    && pecl install xdebug-2.7.1 \
        && docker-php-ext-enable xdebug
RUN  docker-php-ext-install zip exif pcntl
RUN  docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN  docker-php-ext-install gd

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Copy existing application directory contents
COPY . /var/www

RUN (crontab -l ; echo "* * * * * /usr/bin/php /var/www/artisan schedule:run >>/dev/null 2>&1") | crontab

RUN echo "sergalas:x:1000:1000:sergalas,,,:/home/sergalas:/bin/bash" >> /etc/passwd

# Expose port 9000 and start php-fpm server
EXPOSE 9000
#CMD ["php-fpm"]
#CMD  service supervisor start; php-fpm

вхожу в контейнер php делаю
www@5a8f0e4332d7:/var/www$ php artisan migrate
получаю ошибку
php artisan migrate

   Illuminate\Database\QueryException 
  could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')
  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
         // If an exception occurs when attempting to run a query, we'll format the error
         // message to include the bindings with SQL, which will make this exception a
         // lot more helpful to the developer instead of just the database's errors.
         catch (Exception $e) {
            throw new QueryException(
                $query, $this->prepareBindings($bindings), $e
            );
         }
+34 vendor frames 
  35  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

подскажите почему ?
  • Вопрос задан
  • 1244 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы