I've been getting error SQLSTATE[08006] [7] timeout expired (SQL: select count(*) as aggregate from "users")
I've set the postgresql listen address to 0.0.0.0 but it doesn't sort out
Need better workaround of this
The .env file:
DB_CONNECTION=pgsql
DB_HOST=172.17.0.1 // <-- this won't connect. I declare like that based on docker0
DB_PORT=5432
DB_DATABASE=mydb
DB_USERNAME=postgres
DB_PASSWORD=postgres
The docker-compose.yml file:
version: '3'
networks:
laravel:
driver: bridge
volumes:
dbdata:
driver: local
services:
nginx:
build:
context: .
dockerfile: ./docker/nginx.dockerfile
container_name: nginx
ports:
- "${DOCKER_SITE_HOST}:80"
volumes:
- .:/var/www/html
depends_on:
- php
networks:
- laravel
php:
build:
context: .
dockerfile: ./docker/php.dockerfile
container_name: php
volumes:
- .:/var/www/html
ports:
- "9000:9000"
networks:
- laravel
composer:
build:
context: .
dockerfile: ./docker/composer.dockerfile
container_name: composer
volumes:
- .:/var/www/html
working_dir: /var/www/html
depends_on:
- php
user: laravel
entrypoint: [ 'composer', '--ignore-platform-reqs' ]
networks:
- laravel
artisan:
build:
context: .
dockerfile: ./docker/php.dockerfile
container_name: artisan
volumes:
- .:/var/www/html
working_dir: /var/www/html
user: laravel
entrypoint: [ 'php', '/var/www/html/artisan' ]
networks:
- laravel