I have a project structure as below
├───Project
│ ├───ServiceA
│ │ DockerFile
│ │ main.py
│ └───CommonFilesFolder
│ utils.py
and my DockerFile looks as below
FROM <base-image>
COPY . /app/
COPY ../CommonFilesFolder/ /app/CommonFilesFolder
ENV PYTHONPATH /app/
RUN pip install -U -r requirements.txt
WORKDIR /app/
CMD [ "python", "main.py"]
I understand that the line COPY . /app/
will copy all the contents of ServiceA Folder (The folder in which the DockerFile exists) to the container's app folder.
Similarly, I also want to copy the folder CommonFilesFolder into the /app, so I tried the line
COPY ../CommonFilesFolder/ /app/CommonFilesFolder
which is throwing me the error during the build
error: failed to solve: failed to compute cache key: "/CommonFilesFolder" not found: not found. Failed to build container
How exactly can I change the line COPY ../CommonFilesFolder/ /app/CommonFilesFolder
to copy to the container.