Docker Add every file in current directory

后端 未结 2 606
广开言路
广开言路 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: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.

提交回复
热议问题