FROM docker-ro.visable.com/wlw_node:14.14.0-alpine WORKDIR /app ENV PORT 3000 ENV NUXT_HOST=0.0.0.0 ENV NUXT_PUBLIC_PATH=/company_profile_frontend/_nuxt/ COPY package.json yarn.lock /app/ COPY . /app RUN yarn install # Expose port EXPOSE $PORT CMD [ "nuxt" ]
When I run this with
docker run -d -p 3000:3000 company-profile-frontend-dev
things work fine -
nuxt is found and executed. (its framework built on top of Node/Vue)
the issue with the above is my host codebase and my container codebase isn’t in sync which is as you can imagine kind of problematic.
Volumes to the rescue!
Run from the directory of the app:
docker run --name cpp-dev -d -p 3000:3000 -v $PWD:/app company-profile-frontend-dev
Unfortunately this doesn’t work,
nuxt is not found. (it works when node_modules are installed on my localhost machine)