Composer with docker-compose php interpreter


Please tell me how can i install composer with docker-compose and Dockerfile?

I am trying to use project on my local machine without installing anything, use only docker services. I want to install composer that way i will able to use it after setting my docker-compose php interpreter (with this no problems, PDO working and localhost show me data from php files ) and set for composer CLI interpreter php from docker--compose. So after that if i open composer.json in app folder it will execute any composer command with composer installed via docker compose

Thanks in advance

1 comment
Comment actions Permalink

Sorry for disturbing 

I just add to Dockerfile

RUN curl -sS | php -- --install-dir=/usr/bin --filename=composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

And it worked


Please sign in to leave a comment.