flxn/qrcode2stl

Dockerfile - cant run

Opened this issue · 1 comments

Hey mate,
I'm no pro with Docker but I can generally stumble my way around.

When I attempt to build the Dockerfile I get:

npm notice 
npm notice New minor version of npm available! 8.5.5 -> 8.9.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.9.0>
npm notice Run `npm install -g npm@8.9.0` to update!
npm notice 
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: qrcode2stl@1.10.0
npm ERR! Found: eslint@7.4.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^7.4.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from eslint-plugin-vue@6.2.2
npm ERR! node_modules/eslint-plugin-vue
npm ERR!   dev eslint-plugin-vue@"^6.2.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-05-06T12_18_54_490Z-debug-0.log
The command '/bin/sh -c npm install && npm install -g http-server && npm run build' returned a non-zero code: 1

I attempted to add:

RUN yarn run build; exit 0 RUN yarn run build

above the npm install line but that didn't change anything. I also tried:

RUN npm install -g npm@8.9.0 && npm install -g http-server && npm run build --legacy-peer-deps

That gets me a bit further, it ends with:

sh: 1: vue-cli-service: not found

So I edited the npm line to:

npm install -g npm@8.9.0 && npm install -g http-server && npm install -g @vue/cli && npm run build --legacy-peer-deps

That got me way further... but now I'm just stuck coz it tells me:

sh: 1: vue-cli-service: not found
The command '/bin/sh -c npm install -g npm@8.9.0 && npm install -g http-server && npm install -g @vue/cli && npm run build --legacy-peer-deps' returned a non-zero code: 127

I managed to run the Dockerfile successfully. Here is how my Dockerfile looks.

FROM node:lts-bullseye-slim

WORKDIR /usr/src/app

RUN apt-get update && apt-get -y install \
        git-core \
        autotools-dev \
        automake \
        && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN git clone --single-branch --depth 1 https://github.com/flxn/qrcode2stl.git .

RUN npm install --location=global http-server

RUN yarn
RUN yarn run build; exit 0
RUN yarn run build

RUN mkdir www && mv dist/ www/qrcode2stl/

EXPOSE 8080
CMD [ "http-server", "www" ]