I'm trying to build a django project using docker-compose, such as it is in the Docker Documentation (i use Docker toolbox for Windows 10 Home).
But when i execute the command:
sudo docker-compose run web django-admin startproject composeexample .
I get an bash: sudo: command not found
Then if i execute the same command without "sudo":
docker-compose run web django-admin startproject composeexample .
The image is created but the django project folder is not displayed:
Finally, when i run the command again i get:
Indicating that the project was created in the previous step.
The Dockerfile is:
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
docker-compose.yml
version: '3'
services:
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
and the requirements.txt:
Django>=2.0,<3.0
psycopg2>=2.7,<3.0