docker compose share file between containers docker compose share file between containers nginx nginx

docker compose share file between containers


You can add the volume from one container in another container.Example:

php: image: php:fpm-alpine container_name: php volumes:   - .:/var/www/order entrypoint:   - php-fpm links:   - mysqlnginx: image: nginx:alpine container_name: nginx volumes_from:   - php volumes:   - ./build/nginx.conf:/etc/nginx/conf.d/default.conf links:   - php ports:   - 8080:80

Now the php volume becomes accessible in the nginx container