SQLSTATE[08006] [7] could not translate host name "postgres" to address: No address associated with hostname
version: '3'
services:
laravel:
image: lorisleiva/laravel-docker:latest
volumes:
- ./:/var/www
- composer:/root/.composer/cache
command: php -d memory_limit=256M
service-nginx:
build:
context: ./docker/nginx
depends_on:
- service-php
- laravel
- postgres
volumes:
- ./:/var/www
ports:
- "8080:80"
service-php:
build:
context: ./docker/php
volumes:
- ./:/var/www
hostname: php
service-php-cli:
build:
context: ./docker/php-cli
volumes:
- ./:/var/www
- composer:/root/.composer/cache
command: php -d memory_limit=256M
postgres:
build:
context: ./docker/postgres
ports:
- "65432:5432"
restart: always
environment:
PGDATA: "/var/lib/postgresql/data"
POSTGRES_PASSWORD: qwerty
POSTGRES_USER: root
POSTGRES_DB: database
volumes:
- pgdata:/var/lib/postgresql/data
adminer:
image: adminer
depends_on:
- postgres
restart: always
ports:
- 3000:8080
redis:
image: redis:4.0.5-alpine
command: ["redis-server", "--appendonly", "yes"]
volumes:
composer:
pgdata:
driver: local