I have a gatsby
docker image which works as expected when run with docker run
, but when I run it with docker-compose up
I get the following error:
There was a problem loading the local develop command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you need to run "npm install"? You might need to delete your "package-lock.json" as well.
My Dockerfile
looks like this:
FROM node:12-buster
RUN npm install --global gatsby-cli && gatsby telemetry --disable
WORKDIR /app
COPY package*.json /app/
RUN npm install --force
COPY . .
EXPOSE 8000
CMD ["npm", "run", "develop"]
The compose file looks like this:
frontend:
build: frontend
image: frontend
volumes:
- ./frontend:/app
ports:
- "8000:8000"
depends_on:
- backend