I'm struggling with the docker setup on localhost. When calling a PHP function file_get_contents() with a local domain, I'm getting three warnings:
1. SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
2. Failed to enable crypto
3. failed to open stream: Cannot assign requested address
Originally I have a relatively complex setup with nginx as reverse proxy, selfsigned SSL certs, mariadb, wordpress, wpcli, phpmyadmin, mailhog and redis. For simplicity, I'm pasting a simple docker-compose file. On this setup, I'm getting: file_get_contents() failed to open stream: Cannot assign requested address
version: '3.6'
services:
mysql:
container_name: docker-test-mysql
image: mariadb:latest
volumes:
- ./db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: root
MYSQL_PASSWORD: root
MYSQL_DATABASE: docker-test
restart: always
ports:
- 3306:3306
networks:
- webnet
wordpress:
container_name: docker-test-wordpress
image: wordpress:latest
ports:
- 8000:80
volumes:
- wp_data:/var/www/html:rw,cached
- ./wordpress:/var/www/html:rw,cached
depends_on:
- mysql
restart: always
environment:
WORDPRESS_DB_NAME: docker-test
WORDPRESS_TABLE_PREFIX: wp_
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: root
WORDPRESS_DEBUG: 1
networks:
- webnet
networks:
webnet:
external: true
driver: bridge
volumes:
db_data: {}
wp_data: {}
The function works when calling with an external domain, but fails only with local domains (https://my-local-domain.local or http://localhost:8000).
What am I missing? Any help is appreciated!
Best regards