Error response from daemon: invalid volume specification docker error

I'm using Docker Desktop for Windows on Windows 10. I wanted to run a very simple project from django on Docker locally. after the command "docker build ." everything was OK, but after the command "docker-compose up" I got an error: "Error response from daemon: invalid volume specification : 'C:\Users\elahe\postgre2:/code:rw" I've tried this project on two different windows 10. on one of them, I had no problem, but on the second one I got the mentioned error so I guess my problem is because of the windows or docker setting, is it right?

#dockerfile:

FROM python:3.9

ENV PYTHONDONTWRITECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /code

COPY requirements.txt /code/
RUN pip install -r requirements.txt

COPY . /code/
# docker-compose:

version: '3.9'

services:
  web:
    build: .
    command: python /code/manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - 8000:8000
Back to Top