Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3"
- services:
- app:
- build:
- context: .
- dockerfile: docker/app/Dockerfile
- volumes:
- - my_folder:/var/www/html/vendor
- - .:/var/www/html
- volumes:
- my_folder:
- FROM composer AS php_builder
- COPY . /app
- #RUN composer install --no-dev
- RUN mkdir -p vendor && echo "I'm dependency!" > vendor/dependencies.txt
- FROM php:7.1-fpm
- COPY --from=php_builder /app/vendor /var/www/html/vendor
- shubuntu1@shubuntu1:~/test$ ls
- docker docker-compose.yaml index.php
- shubuntu1@shubuntu1:~/test$ docker-compose up -d
- Creating network "test_default" with the default driver
- Creating test_app_1 ... done
- shubuntu1@shubuntu1:~/test$ docker exec -it test_app_1 /bin/bash
- root@bf59d8684581:/var/www/html# ls
- docker docker-compose.yaml index.php vendor
- root@bf59d8684581:/var/www/html# cat vendor/dependencies.txt
- I'm dependency!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement