SHARE
TWEET

Untitled

a guest Jul 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. version: "3"
  2.  
  3. services:
  4.   app:
  5.     build:
  6.       context: .
  7.       dockerfile: docker/app/Dockerfile
  8.     volumes:
  9.       - my_folder:/var/www/html/vendor
  10.       - .:/var/www/html
  11.  
  12. volumes:
  13.   my_folder:
  14.      
  15. FROM composer AS php_builder
  16. COPY . /app
  17. #RUN composer install --no-dev
  18. RUN mkdir -p vendor && echo "I'm dependency!" > vendor/dependencies.txt
  19.  
  20. FROM php:7.1-fpm
  21. COPY --from=php_builder /app/vendor /var/www/html/vendor
  22.      
  23. shubuntu1@shubuntu1:~/test$ ls
  24. docker  docker-compose.yaml  index.php
  25. shubuntu1@shubuntu1:~/test$ docker-compose up -d
  26. Creating network "test_default" with the default driver
  27. Creating test_app_1 ... done
  28. shubuntu1@shubuntu1:~/test$ docker exec -it test_app_1 /bin/bash
  29. root@bf59d8684581:/var/www/html# ls
  30. docker  docker-compose.yaml  index.php  vendor
  31. root@bf59d8684581:/var/www/html# cat vendor/dependencies.txt
  32. I'm dependency!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top