Docker Add every file in current directory

后端 未结 2 610
广开言路
广开言路 2021-02-14 20:37

I have a simple web application that I would like to place in a docker container. The angular application exists in the frontend/ folder, which is withing the

相关标签:
2条回答
  • 2021-02-14 21:05

    First, try COPY just to test if the issue persists.

    Second, make sure that no files are copied by changing your CMD to a ls frontend

    I do not see a WORKDIR in node/7.5/Dockerfile, so frontend could be in /frontend: check ls /frontend too.

    0 讨论(0)
  • 2021-02-14 21:18

    The Dockerfile that ended up working was

    FROM node
    ADD . / frontend/
    RUN (cd frontend/; npm install;)
    CMD (cd frontend/; npm start;)
    

    Shoutout to @Matt for the lead on . / ./, but I think the only reason that didn't work was because for some reason my application will only run when it is inside a directory, not in the 'root'. This might have something to do with @VonC's observation that the node image doesn't have a WORKDIR.

    0 讨论(0)
提交回复
热议问题