I’ve been working with Docker for about a few days and I confused with installing & running different extensions in Docker with composer.The main issue is that I can’t properly install compoer inside my php dockerfile & docker-compose.My goal is to install the composer itself and guzzle library for my running php & nginx docker container.
php dockerfile:
ENV COMPOSER_ALLOW_SUPERUSER=1
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY ./src/composer.* ./
RUN composer install
COPY ./src .
docker-compose.yaml:
services:
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
ports:
- "8080:80"
networks:
- internal
volumes:
- ./src/:/var/www/html/
- ./logs/nginx:/var/log/nginx/
php:
build:
context: .
dockerfile: php/Dockerfile
networks:
- internal
volumes:
- ./src/:/var/www/html/
- ./logs/php.log:/var/log/fpm-php.www.log
- ./vendor/:/var/www/html/
- ./composer.json/:/var/www/html/
- ./composer.lock/:/var/www/html/
networks:
internal:
driver: bridge
New contributor
halunkatheking is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.