loading...

re: Run a React App in a Docker Container VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi there Peter! I believe you made a mistake there at line #3 in the Dockerfile. You should copy files in project directory to your workdirectory ...
 

Hi Justina!

In the line above that one, I am setting the working directory (inside the container) to /app (WORKDIR /app) and then copying everything from build context root (which is the current folder on my host machine in this case: .) to the target folder inside the container. Since the working directory is set to /app the . in the COPY instruction copies everything to that folder.

If I removed the WORKDIR, I would also need to update the COPY instruction to read COPY . /app

Thanks,
Peter

code of conduct - report abuse