Issue with Composer CLI Interpreter

Hello,

I am having a slight issue with the Composer CLI remote interpreter within one of my projects.

As a bit of additional information, I am running my application inside a Docker network where each container is given an alias hostname (i.e. redis, mysql etc..):

version: '3'
services:

# Application
app:
build:
context: ./
dockerfile: Dockerfile.dev
working_dir: /var/www/html
volumes:
- ./webroot:/var/www/html
networks:
- laravel

# Web Server
nginx:
image: nginx:1.19.2-alpine
ports:
- "8005:80"
volumes:
- ./webroot:/var/www/html
- ./docker/vhost.conf:/etc/nginx/conf.d/default.conf
depends_on:
- app
- mysql
- redis
networks:
- laravel

# MySQL Database
mysql:
image: mysql:8.0.21
restart: unless-stopped
tty: true
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
networks:
- laravel

# Redis Database
redis:
image: redis:5.0.6
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: [ "redis-server", "--appendonly", "yes" ]
networks:
- laravel

networks:
laravel:

volumes:
db-data:
redis-data:

When running commands directly from the terminal, I am able to run scripts such as docker-compose exec app composer run post-autoload-dump and everything will work perfectly.

However when I use the built in run configuration screen, it just won't work at all. I get the following issue suggesting it can't resolve the alias hostname redis.

In my mind both are using the composer instance remotely installed within the docker container, so I don't see any reason why there would be any difference. I am wondering if I have done anything incorrectly when setting up composer / docker in the settings:

In particular I am wondering if my network mode / extra host settings need to be configured differently. Any help anyone could offer would be really appreciated!

1 comment
Comment actions Permalink

Could you please share what command is being executed by IDE when you run this composer script?

0

Please sign in to leave a comment.