Я запускаю проект на yii2 в докере. Проблема в том, что при открытии любого внешнего ресурса, через fopen, curl и так далее я ловлю ошибку :
fopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution docker-compose
version: '3.5'
services:
nginx:
container_name: ${COMPOSE_PROJECT_NAME}_nginx
image: nginx:latest
restart: always
ports:
- "${NGINX_PORT}:80"
- "${NGINX_PORT_SSL}:443"
volumes:
- ./docker/nginx/${NGINX_HOST}.conf:/etc/nginx/conf.d/default.conf
- .:/var/www/${COMPOSE_PROJECT_NAME}
links:
- php
php:
container_name: ${COMPOSE_PROJECT_NAME}_php
build: ./docker/php
restart: always
volumes:
- .:/var/www/${COMPOSE_PROJECT_NAME}
links:
- postgres
postgres:
container_name: ${COMPOSE_PROJECT_NAME}_postgres
image: postgres:latest
restart: always
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- ./docker/postgres:/var/lib/postgresql/data
- ./docker/dump:/tmp/dump
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
PGDATA: ${POSTGRES_DATA}
front:
container_name: ${COMPOSE_PROJECT_NAME}_front
build: ./docker/front
restart: always
volumes:
- .:/var/www/${COMPOSE_PROJECT_NAME}
environment:
NODE_ENV: ${NGINX_HOST}
DEBUG: ${APP_DEBUG}