Hi guys
I am creating a php docker container.
I need to composer install inside the container and i would like to persist the vendor folder load by composer on the host device.
The composer install well inside the container the vendor folder creates well on the host but nothing inside the folder inside the host vendor folder (container vendor folder contains everything properly).
Do someone has the same problem than me?
Dockerfile
FROM php:7.4-apache-buster
WORKDIR /var/www/src
# Sources
COPY ./src /var/www/src
# Install composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer
RUN composer install
EXPOSE 80
docker-compose.yml file
version: '3'
services:
server:
build:
context: ./
dockerfile: ./docker/php/Dockerfile
volumes:
- ./src:/var/www/src
- /var/www/src/vendor