Reputation: 2759
I have the following docker-compose.yml configuration:
version: '3'
services:
proxy:
image: nginx:latest
container_name: webproxy
ports:
- "80:80"
volumes:
- /etc/nginx/sites-available:/etc/nginx/sites-available
On my host machine I have a nginx.conf
file at /etc/nginx/sites-available/nginx.conf
.
Steps:
docker-compose -up
sudo docker exec -it 687 /bin/bash
/etc/nginx/sites-available
Unfortunately the folder in step 3 is empty. My nginx.conf
file is not being copied.
Is my docker-compose
file not configured properly, or are volumes not supposed to also copy and start with the host data?
Upvotes: 0
Views: 317
Reputation: 139
Doesn't looks anything wrong in docker-compose.yaml , because I used the same file as mentioned by you to create docker container. It worked for me. check your content inside /etc/nginx/sites-available on your host machine.
Upvotes: 1