I am running my node app in a container using VS Code Remote. Generally, I created .devcontainer\devcontainer.json
and .devcontainer\DockerFile
and it starts container on it's own and everything work just fine.
Now when I try to move to production that uses AWS ECR and ECS I try to build image. When I build it through the terminal I can error because of COPY . .
copy content of .devcontainer
the folder where DockerFile exists. If I change to COPY .. .
I have another error that COPY cannot copy the parent folder.
I try to run the command Rebuild Container in VS Code menu but that image woks only in VS Code and when I upload it fails to run.
So, now I move DockerFile to root, run docker build command then move that file back and upload that image to ECR registry.
What do I miss here? I have very simple node file
FROM node:12-alpine
ENV NODE_ENV dev
RUN mkdir /home/node/app \
&& apk add git
WORKDIR /home/node/app
COPY . .
VOLUME ["/var/log/icod"]
CMD ["node", "/home/node/app/src/index.js"]