I'm trying to use docker for a firebase project, for firebase the package.json is in a sub folder called functions. I'm using the node:alpine image.
In my Dockerfile, I need to cd into the functions directory then run npm run start. How do I do this, please?
I have tried CMD [ "cd", "functions", ";", "npm", "run", "serve" ], I got this error /usr/local/bin/docker-entrypoint.sh: exec: line 8: cd: not found
FROM node:alpine
WORKDIR '/app'
RUN npm install -g firebase-tools
COPY functions/package*.json functions/
RUN cd functions && npm install && cd ..
COPY . .
CMD [ "cd", "functions", ";", "npm", "run", "serve" ]
[], the command is being executed directly, not via a shell. That also means that the ";" would be passed as a parameter and not be interpreted as a command separator. Basically, you tried the equivalent of/bin/cd function \; npm run serve