Skip to content

Instantly share code, notes, and snippets.

@hassan00dev
Last active July 17, 2024 14:23
Show Gist options
  • Select an option

  • Save hassan00dev/7dd5f7cf5ce215a88020c54faf31edb9 to your computer and use it in GitHub Desktop.

Select an option

Save hassan00dev/7dd5f7cf5ce215a88020c54faf31edb9 to your computer and use it in GitHub Desktop.
Install PHP dependencies via docker composer
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