Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Copy folder with sub directory in Docker

I am trying to copy a folder with contents. But when trying to access the file from docker it shows error ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirements/development.txt’

FROM python
ENV PYTHONUNBUFFERED=1
RUN apt-get update \
    && pip install pip install gunicorn
WORKDIR /usr/src/app

COPY requirements/* /usr/src/app/
RUN pip install -r requirements/development.txt
COPY . .
EXPOSE 8000
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "3", "cryb.wsgi:application"] 

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

COPY requirements/* /usr/src/app/

You’re copying stuff from requirements to /usr/src/app. This does NOT preserve directory structure. Make that

RUN mkdir /usr/src/app/requirements
COPY requirements/* /usr/src/app/requirements/
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading