I would highly appreciate if someone had a solution for this, as I've been scratching my head with it for weeks..
So here's the problem : I have a Vue-Application which uses ZingChart-Vue and Vue-Multiselect. When i do npm run serve
it perfectly serves, at port 8080. When I do npm run build
, it perfectly builds. However, when I do docker-compose up, these two things (ZingChart-Vue and Vue-Multiselect) mess it up.
Here's the error: https://i.sstatic.net/tOXgk.png
This application is meant to be used for a CI/CD pipeline using github actions, but of course it gives an error too: https://i.sstatic.net/PFAQK.png
Here is the package.json file: https://www.codepile.net/pile/QeboY1mw
Here is the package-lock.json file: https://www.codepile.net/pile/NDGRXY90
Here's the docker file:
FROM node:12-alpine as application_modules
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
# Test and lint and Prod build
FROM node:12-alpine as prod_build
WORKDIR /usr/src/app
COPY . .
COPY --from=application_modules /usr/src/app/node_modules ./node_modules
RUN npm test && npm run lint && npm run build
# Install Server dependencies
FROM node:12-alpine as server_modules
WORKDIR /usr/src/app
COPY container-package.json ./package.json
RUN npm install
# Start Server
FROM node:12-alpine
WORKDIR /usr/src/app
COPY --from=prod_build /usr/src/app/dist ./dist
COPY --from=server_modules /usr/src/app/node_modules ./node_modules
COPY server.js ./
COPY container-package.json ./package.json
ENV PORT=8080
EXPOSE 8080
CMD ["npm", "start"]
I found out the answer - Make sure you install Git on the pipeline (probably best to do it right after you install node!)