If the `app.js` file is in a subdirectory, how do I ensure Docker correctly copies it?

Responsive Ad Header

Question

Grade: Education Subject: Support
If the `app.js` file is in a subdirectory, how do I ensure Docker correctly copies it?
Asked by:
86 Viewed 86 Answers

Answer (86)

Best Answer
(192)
Use a relative path from the root of the Dockerfile's context. For example, if `app.js` is in a directory named `src` within your project, the `COPY` command should be `COPY src/app.js /app/`.