Background:
- Running Linux Containers on Docker
- Using WSL2
- Running a flask app on Docker - succeeded
- Built a nginx config file and that fails while doing docker-compose
nginx.config file is as follows:
events {
worker_connections 1000;
}
http {
server {
listen 80;
location / {
proxy_pass http://app:5000
}
}
}
docker-compose yml is as follows:
version: '3'
services:
app:
build:
context: app
ports:
- "5000"
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app
ports:
- "80:80"
while executing this: docker-compose up -d --build --scale app=3
My error is: Error response from daemon: CreateFile pathspecified\nginx.conf: Access is denied.
I researched and it said WSL2 automatically shares all files from windows, so I am not able to get why this error comes after I create nginx.config? How can I fix this?