I'm new to the docker-code ignitor world. Issue is I cannot use file_get_contents
inside the app as it keeps throwing the error:
file_get_contents(http://127.0.0.1:5000/index.php/lucky_api/get_population): failed to open stream: Connection refused
If I hard code the docker container IP address then it works. But I need to use the base_url so that I don't have to manually change the IP address every time I do docker-compose up.
My docker-compose.yml looks like this:
version: '2'
services:
lucky:
extends:
file: common.yml
service: lucky
image: docker-lucky:local
ports:
- "5000:80"
volumes:
- ~/dev/LUCKY:/var/www/html
oracle-db:
extends:
file: common.yml
service: oracle-db
image: oracle/database2:11.2.0.2-xe
shm_size: '1gb'
ports:
- "1521:1521"
environment:
- ORACLE_PWD=12345
volumes:
- ~/dev/oracle-db/data:/u01/app/oracle/oradata
- ~/dev/oracle-db/dumpFiles:/docker-entrypoint-initdb.d/startup