I have created an nginx container that is open to port 8080:80 so I could access it from the host.
it is connected to php fpm container that has an open port 9000:9000
nginx successfully runs with php.
My problem is that php tries to access localhost:8080 but the problem is that the php localhost:8080 is not valid, it needs to connect to the nginx container.
here is the error on my wordpress site: you can see that something is funky there... below I'll attach my docker-compose.yml
Downloading install package from http://localhost:8080/wp-content/themes/realtyspace/plugins/advanced-custom-fields-pro.zip…
Download failed. cURL error 7: Failed to connect to localhost port 8080: Connection refused
docker-compose.yml
version: '2'
services:
my-nginx:
build: .
volumes:
- ./../:/var/www/html
ports:
- "8080:80"
links:
- my-php
my-php:
build:
context: .
dockerfile: Dockerfile.php-fpm
volumes:
- ./../:/var/www/html
ports:
- "9000:9000"
links:
- my-mysql
my-mysql:
image: mariadb:5.5
volumes:
- /var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: wp
MYSQL_DATABASE: wp
MYSQL_USER: wp
MYSQL_PASSWORD: wp