I have a vue project. I don't want to keep my environments at my host, I prefer to deal with docker. So, why it is so damn stupidly tedious and hard to deal with node that way? So I created Dockerfile with node, docker-compose.yml and pre-installed a vue-cli project via hepler node:alpine container. Then I'm going to make working compose thing. But it's not working! Because my global npm packages just not found. There's nothing in google that helped me.
docker-compose.yml
version: '3'
services:
app:
build: .
container_name: app
ports:
- "8080:8080"
volumes:
- "./:/app"
Dockerfile
FROM node:alpine
RUN npm install -g @vue/cli @vue/cli-service-global
WORKDIR /app/app
ENTRYPOINT ["vue-cli-service", "serve"]
(there's another app inside /app it's ok)
And the error:
[bxp@manjaro vue]$ docker-compose up -d
Removing app
Recreating 801627fa0179_app ... error
ERROR: for 801627fa0179_app Cannot start service app: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "vue-cli-service": executable file not found in $PATH: unknown
ERROR: for app Cannot start service app: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "vue-cli-service": executable file not found in $PATH: unknown
ERROR: Encountered errors while bringing up the project.