Trying to deploy my app using a dockerfile.
While using “docker build .” is working, “fly deploy” - is not.
Adding “–local-only” does not help.
I get the following messages:
Trying to deploy my app using a dockerfile.
While using “docker build .” is working, “fly deploy” - is not.
Adding “–local-only” does not help.
I get the following messages:
Sounds like an issue with file permissions perhaps related to packaging up files for use on a build (if I had to guess).
Part of the error message seems to indicate updating npm may fix it - is that possible in your setup? (the answer depends a bit on how the dockerfile is configured and which base images are used)
Thanks for the answer!
But I suspect the problem is related to how fly deploy
executes Docker, for the reason that local docker build .
works perfectly, while fly deploy
- does not.
This is the Dockerfile:
FROM node:16.13.1
RUN apt-get update
RUN npm install -g npm@8.19.2
WORKDIR /app
COPY . ./
RUN npm run install-production
RUN npm run build-production
EXPOSE 8080
CMD npm run run-production
The only thing I suspect is COPY . ./
which copies the node_modules folder - which is not recommended.
Thanks again!
Looks like it is an issue related to the different way “flyctl” treats the “.dockerignore” file…
To my knowledge the .dockerignore
file is just being used by docker itself, and fly doesn’t actually attempt to read/parse it.
Can you show your .dockerignore
file here? I’m assuming node_modules
is defined within it?
So … were you able to resolve this?