I'm trying to create a docker image from code that I download from a github repository. This is all done in the Dockerfile. Next, I want to make this directory accessible from the host machine. But when I specify it as a volume, the directory remains empty on the host machine after starting the container. But inside the container, the directory contains files.
Here is docker-compose.yml, but folder empty
services:
p_parser:
container_name: p_parser
hostname: p_parser
image: local/parser:1.0
working_dir: /var/www/parser
build:
context: ./build/parser/
dockerfile: Dockerfile
args:
- SSH_PRIVATE_KEY
restart: unless-stopped
networks:
- default
volumes:
- p_parser_volume:/srv/var/www/p_parser
- ./configs/p_parser/php.ini:/etc/php/8.1/cli/php.ini:delegated
volumes:
p_parser_volume:
driver: local
driver_opts:
device: ./data/p_parser
o: bind
type: none