COPY failed: file not found in build context or excluded by .dockerignore: stat app: file does not exist
У меня возникла проблема, когда я запустил :
sudo docker-compose up -d --build
Я получаю эту ошибку :
Sending build context to Docker daemon 281.1MB
Step 1/12 : FROM python:3.9.6-alpine
---> 0238e48b207f
Step 2/12 : ENV PYTHONDONTWRITEBYTECODE 1
---> Using cache
---> a03ccfedc62e
Step 3/12 : ENV PYTHONUNBUFFERED 1
---> Using cache
---> 77317bf71fab
Step 4/12 : COPY ./requirements.txt /requirements.txt
---> Using cache
---> 4b6f8c9c33c8
Step 5/12 : RUN apk add libffi-dev
---> Using cache
---> 12e20c847c71
Step 6/12 : RUN apk add -u zlib-dev jpeg-dev gcc musl-dev
---> Using cache
---> 768f9b4c4f86
Step 7/12 : RUN python3 -m pip install --upgrade pip
---> Using cache
---> 41c9d9b5ebc9
Step 8/12 : COPY ./requirements.txt /usr/src/app
---> Using cache
---> fbb27974c713
Step 9/12 : RUN pip install -r requirements.txt
---> Using cache
---> 442d7cb81277
Step 10/12 : RUN mkdir /app
---> Using cache
---> 687beeed37e6
Step 11/12 : COPY ./app /app
COPY failed: file not found in build context or excluded by .dockerignore: stat app: file does not exist
ERROR: Service 'app' failed to build : Build failed
(venv) idris@idris-G3-3579:~/Documents/workspace/moove$
Ниже находится docker-compose.yml
файл :
version: '3'
services:
app:
build:
context: .
ports:
- "8000:8000"
volumes:
- ./app:/app
command: >
sh -c "python3 manage.py migrate &&
python3 manage.py run_data_exceptions &&
python3 manage.py runserver 0.0.0.0:8000"
env_file:
- ./.env
depends_on:
- db
db:
image: postgres:10-alpine
env_file:
- ./.env
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:alpine
celery:
restart: always
build:
context: .
command: celery -A app worker -l info
volumes:
- ./app:/app
env_file:
- ./.env
depends_on:
- db
- redis
- app
volumes:
pgdata:
а также это мой Dockerfile
:
FROM python:3.9.6-alpine
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install dependencies
COPY ./requirements.txt /requirements.txt
RUN apk add libffi-dev
RUN apk add -u zlib-dev jpeg-dev gcc musl-dev
RUN python3 -m pip install --upgrade pip
COPY ./requirements.txt /usr/src/app
RUN pip install -r requirements.txt
RUN mkdir /app
COPY ./app /app
WORKDIR /app
Что может быть не так?