DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can remove composer dev dependencies when I build my application for production using docker multi-stage build?

Hello coleagues,
I try a sample multi-stage build for php aplications, but I have a questions that I would love if you could help me with:

I am building my php application into a Docker image using multistage builds as a CI/CD pipeline:

FROM etable/php7.2-dev as build

COPY . /var/www/html/
RUN composer install --dev
RUN echo "Run unit tests" && ./vendor/bin/phpunit
RUN echo "Remove unit tests" && rm -rf /var/www/html/tests
RUN echo "Remove webpack" && rm






?signin=true

Merry Christmas!!!!

Top comments (0)