Last active
July 17, 2024 14:23
-
-
Save hassan00dev/7dd5f7cf5ce215a88020c54faf31edb9 to your computer and use it in GitHub Desktop.
Install PHP dependencies via docker composer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM composer | |
| COPY . /app | |
| WORKDIR /app | |
| ENV PHP_VERSION=7.4.32 | |
| ENV PHP_URL=https://www.php.net/distributions/php-7.4.32.tar.xz | |
| ENV PHP_ASC_URL=https://www.php.net/distributions/php-7.4.32.tar.xz.asc | |
| RUN echo $PHP_VERSION | |
| RUN composer install --ignore-platform-reqs --no-scripts | |
| # Keep the container running for copying files (useful for debugging) | |
| CMD tail -f /dev/null | |
| # docker build -t composer-docker . | |
| # docker images | |
| # docker run --rm --interactive --tty --name composer-container composer-docker | |
| # docker run --rm -it composer-docker | |
| # docker images ls | |
| # docker ps | |
| # docker cp composer-container-instance:/app/vendor ./vendor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment