When creating the Docker image of my application which has “Couchbase” in it’s package.json errors out with the following message:
Dockerfile
FROM node:10.13-alpine
ENV NODE_ENV production
ENV REDIS_URL redis://cache
ENV PORT 3001
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --production
COPY . /usr/src/app
EXPOSE 3001
CMD npm run prod
Compilation error:
Step 7/10 : RUN npm install --production
—> Running in e1c0804a023e
couchbase@2.6.10 install /usr/src/app/node_modules/couchbase
prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=10.13.0 runtime=node arch=x64 libc=musl platform=linux)
gyp ERR! configure error
gyp ERR! stack Error: Can’t find Python executable “python”, you can set the PYTHON env variable.
Package.json
"dependencies": {
"axios": "^0.19.2",
"babel-loader": "^8.0.0-beta.0",
"body-parser": "^1.19.0",
"cookie-parser": "~1.4.4",
"couchbase": "^2.6.10",
"dateformat": "^3.0.3",
"debug": "~2.6.9",
"express": "~4.16.1",
"http-errors": "~1.6.3",
"jsonwebtoken": "^8.5.1",
"morgan": "~1.9.1",
"npm-run-all": "^4.1.5",
"pug": "^2.0.4",
"redis": "^2.8.0",
"rimraf": "^3.0.2"
},
"devDependencies": {
"@babel/cli": "^7.8.3",
"@babel/core": "^7.8.3",
"@babel/node": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"dotenv": "^8.2.0",
"dotenv-flow": "^3.1.0",
"nodemon": "^2.0.2"
}
I’m running my code on Windows 10 x64. The same code is working for me by some additional configurations made to my PC i.e. installing windows-build-tools and node-gyp, configuring node-gyp for python variable and msvs_version to 2017.
Please suggest your ideas so that I can create a docker image from my system and run it.
Thank you
Ankit Lalan