I have a very simple docker-compose.yml
file where I use nginx
and mounting a file as a volume.
But everytime I run the application, it is creating a directory .htpasswd
without really mounting the .htpasswd
file where I locally.
This is the docker-compose.yml
.
version: '3'
services:
reverse:
container_name: reverse
hostname: reverse
restart: unless-stopped
image: nginx
ports:
- 80:80
- 443:443
volumes:
- ./nginx/.htpasswd:/etc/nginx/conf.d/.htpasswd
Can someone help me fix this?
2
Answers
by default if binded to a none existent path, docker will create a folder, the solution would be in your case to create the path before running your
docker-compose
How are you running Docker? here’s an answer …
For Mac with Minikube/Hyperkit docker and Docker Compose
Since I’m not using Docker Desktop any longer, I’ve experienced numerous issues similar to "docker in docker (dind)" paradigm with minikube…
e.g., easiest way was to mount the exact home path…
docker-compose.yaml