scalablescripts / auth-api

22 stars 28 forks source link

Cannot run the backend #2

Open papakonstantinouko opened 3 years ago

papakonstantinouko commented 3 years ago

On Windows 10 and running git bash in admin mode I get the following error when executing docker-compose up

image

actionjacks commented 3 years ago

after run docker exec backend /bin/sh start.sh got error `Application key set successfully.

Illuminate\Database\QueryException

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = auth and table_name = migrations and table_type = 'BASE TABLE')

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678 674▕ // If an exception occurs when attempting to run a query, we'll format the error 675▕ // message to include the bindings with SQL, which will make this exception a 676▕ // lot more helpful to the developer instead of just the database's errors. 677▕ catch (Exception $e) { ➜ 678▕ throw new QueryException( 679▕ $query, $this->prepareBindings($bindings), $e 680▕ ); 681▕ } 682▕

  +36 vendor frames

37 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))`

I think he tried everything, deleting the admin didn't work, I am convinced that this is related to the new docker version I am too weak, I do not know how to put the server

pathy-jp commented 3 years ago

Yes, I got to same issue

utkzas commented 3 years ago

Same, I am also getting the same issue SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = auth and table_name = migrations and table_type = 'BASE TABLE')

utkzas commented 3 years ago

This tutorial left all of us hanging ;(

lee98064 commented 2 years ago

after run docker exec backend /bin/sh start.sh got error `Application key set successfully.

Illuminate\Database\QueryException

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = auth and table_name = migrations and table_type = 'BASE TABLE')

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678 674▕ // If an exception occurs when attempting to run a query, we'll format the error 675▕ // message to include the bindings with SQL, which will make this exception a 676▕ // lot more helpful to the developer instead of just the database's errors. 677▕ catch (Exception $e) { ➜ 678▕ throw new QueryException( 679▕ $query, $this->prepareBindings($bindings), $e 680▕ ); 681▕ } 682▕

  +36 vendor frames

37 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))`

I think he tried everything, deleting the admin didn't work, I am convinced that this is related to the new docker version I am too weak, I do not know how to put the server

Try this docker-compose.yaml

version: '3.9'
services:
  backend:
    container_name: backend
    image: scalablescripts/auth-backend
    environment:
      DB_HOST: 'mysql'
      DB_DATABASE: 'db'
      DB_USERNAME: 'user'
      DB_PASSWORD: '1234'
    ports:
      - 8000:8000
    depends_on:
      - mysql
  mysql:
    image: mysql:latest
    environment:
      MYSQL_DATABASE: 'db'
      MYSQL_USER: 'user'
      MYSQL_PASSWORD: '1234'
      MYSQL_ROOT_PASSWORD: 'root'
    ports:
      - "0.0.0.0:3306:3306"
  phpmyadmin:
    depends_on:
       - mysql
    image: phpmyadmin/phpmyadmin:latest
    ports:
      - "0.0.0.0:3001:80"
    environment:
        PMA_HOST: mysql