Hello,
I am very happy to find Openrouteservice and this forum! I tried to run ORS map client on my own server. However, I failed and got some errors while I trying…
So I would like to ask help and please give me some advices to resolve these problems…
(Apologize for long error logs in advance)
First, I followed the “set up and run” guide in ors-map-client GitHub Readme.
(link: GitHub - GIScience/ors-map-client: Openrouteservice API web SPA client using VueJS, Vuetify and Vue2Leaflet)
-
Here comes the first question: What value do I have to put for
bitlyLogin
insrc/config/app-config.js
? I have done is that I copied “Log in to the Bitly Connections Platform” URL(sign-in page of Bitly) and pasted. -
After configuration, I followed “Run with
docker
” section. I got the error as below while running a command “docker build --tag ors-map-client:local .”.
(skipped the succeeded part...)
28.47 .../node_modules/node-sass postinstall$ node scripts/build.js
28.60 .../node_modules/node-sass postinstall: Binary found at /opt/client/node_modules/.pnpm/node-sass@8.0.0/node_modules/node-sass/vendor/linux-arm64-93/binding.node
28.60 .../node_modules/node-sass postinstall: Testing binary
28.71 .../node_modules/node-sass postinstall: Binary has a problem: Error: Error loading shared library /opt/client/node_modules/.pnpm/node-sass@8.0.0/node_modules/node-sass/vendor/linux-arm64-93/binding.node: Exec format error
28.71 .../node_modules/node-sass postinstall: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1282:18)
28.71 .../node_modules/node-sass postinstall: at Module.load (node:internal/modules/cjs/loader:1076:32)
28.71 .../node_modules/node-sass postinstall: at Function.Module._load (node:internal/modules/cjs/loader:911:12)
28.71 .../node_modules/node-sass postinstall: at Module.require (node:internal/modules/cjs/loader:1100:19)
28.71 .../node_modules/node-sass postinstall: at require (node:internal/modules/cjs/helpers:108:18)
28.71 .../node_modules/node-sass postinstall: at module.exports (/opt/client/node_modules/.pnpm/node-sass@8.0.0/node_modules/node-sass/lib/binding.js:19:10)
28.71 .../node_modules/node-sass postinstall: at Object.<anonymous> (/opt/client/node_modules/.pnpm/node-sass@8.0.0/node_modules/node-sass/lib/index.js:13:35)
28.71 .../node_modules/node-sass postinstall: at Module._compile (node:internal/modules/cjs/loader:1198:14)
28.71 .../node_modules/node-sass postinstall: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
28.71 .../node_modules/node-sass postinstall: at Module.load (node:internal/modules/cjs/loader:1076:32) {
28.71 .../node_modules/node-sass postinstall: code: 'ERR_DLOPEN_FAILED'
28.71 .../node_modules/node-sass postinstall: }
28.71 .../node_modules/node-sass postinstall: Building the binary locally
28.71 .../node_modules/node-sass postinstall: Building: /usr/local/bin/node /opt/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
28.76 .../node_modules/node-sass postinstall: gyp info it worked if it ends with ok
28.77 .../node_modules/node-sass postinstall: gyp verb cli [
28.77 .../node_modules/node-sass postinstall: gyp verb cli '/usr/local/bin/node',
28.77 .../node_modules/node-sass postinstall: gyp verb cli '/opt/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js',
28.77 .../node_modules/node-sass postinstall: gyp verb cli 'rebuild',
28.77 .../node_modules/node-sass postinstall: gyp verb cli '--verbose',
28.77 .../node_modules/node-sass postinstall: gyp verb cli '--libsass_ext=',
28.77 .../node_modules/node-sass postinstall: gyp verb cli '--libsass_cflags=',
28.77 .../node_modules/node-sass postinstall: gyp verb cli '--libsass_ldflags=',
28.77 .../node_modules/node-sass postinstall: gyp verb cli '--libsass_library='
28.77 .../node_modules/node-sass postinstall: gyp verb cli ]
28.77 .../node_modules/node-sass postinstall: gyp info using node-gyp@8.4.1
28.77 .../node_modules/node-sass postinstall: gyp info using node@16.20.1 | linux | arm64
28.77 .../node_modules/node-sass postinstall: gyp verb command rebuild []
28.77 .../node_modules/node-sass postinstall: gyp verb command clean []
28.77 .../node_modules/node-sass postinstall: gyp verb clean removing "build" directory
28.77 .../node_modules/node-sass postinstall: gyp verb command configure []
28.79 .../node_modules/node-sass postinstall: gyp verb find Python Python is not set from command line or npm configuration
28.79 .../node_modules/node-sass postinstall: gyp verb find Python Python is not set from environment variable PYTHON
28.79 .../node_modules/node-sass postinstall: gyp verb find Python checking if "python3" can be used
28.79 .../node_modules/node-sass postinstall: gyp verb find Python - executing "python3" to get executable path
28.79 .../node_modules/node-sass postinstall: gyp verb find Python - "python3" is not in PATH or produced an error
28.79 .../node_modules/node-sass postinstall: gyp verb find Python checking if "python" can be used
28.79 .../node_modules/node-sass postinstall: gyp verb find Python - executing "python" to get executable path
28.80 .../node_modules/node-sass postinstall: gyp verb find Python - "python" is not in PATH or produced an error
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python Python is not set from command line or npm configuration
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python Python is not set from environment variable PYTHON
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python checking if "python3" can be used
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python - "python3" is not in PATH or produced an error
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python checking if "python" can be used
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python - "python" is not in PATH or produced an error
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python **********************************************************
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python You need to install the latest version of Python.
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python you can try one of the following options:
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python (accepted by both node-gyp and npm)
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python - Set the environment variable PYTHON
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python - Set the npm configuration variable python:
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python For more information consult the documentation at:
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python **********************************************************
28.80 .../node_modules/node-sass postinstall: gyp ERR! find Python
28.80 .../node_modules/node-sass postinstall: gyp ERR! configure error
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack Error: Could not find any Python installation to use
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at PythonFinder.fail (/opt/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/lib/find-python.js:330:47)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at PythonFinder.runChecks (/opt/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/lib/find-python.js:159:21)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at PythonFinder.<anonymous> (/opt/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/lib/find-python.js:202:16)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at PythonFinder.execFileCallback (/opt/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/lib/find-python.js:294:16)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at exithandler (node:child_process:410:5)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at ChildProcess.errorhandler (node:child_process:422:5)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at ChildProcess.emit (node:events:513:28)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at onErrorNT (node:internal/child_process:485:16)
28.80 .../node_modules/node-sass postinstall: gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
28.80 .../node_modules/node-sass postinstall: gyp ERR! System Linux 5.15.49-linuxkit-pr
28.80 .../node_modules/node-sass postinstall: gyp ERR! command "/usr/local/bin/node" "/opt/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
28.80 .../node_modules/node-sass postinstall: gyp ERR! cwd /opt/client/node_modules/.pnpm/node-sass@8.0.0/node_modules/node-sass
28.80 .../node_modules/node-sass postinstall: gyp ERR! node -v v16.20.1
28.80 .../node_modules/node-sass postinstall: gyp ERR! node-gyp -v v8.4.1
28.80 .../node_modules/node-sass postinstall: gyp ERR! not ok
28.80 .../node_modules/node-sass postinstall: Build failed with error code: 1
28.80 .../node_modules/node-sass postinstall: Failed
28.80 ELIFECYCLE Command failed with exit code 1.
------
Dockerfile:14
--------------------
12 |
13 | # Only install production.
14 | >>> RUN pnpm install
15 |
16 | COPY build /opt/client/build
--------------------
ERROR: failed to solve: process "/bin/sh -c pnpm install" did not complete successfully: exit code: 1
- I modified
Dockerfile
as below (just add python3 installation code) and somehow docker image has been built.
# Multistage build
# 1. Stage: Build the app
FROM node:16-alpine as build-stage
WORKDIR /opt/client/
# System deps and app setup:
RUN apk --no-cache add 'build-base>=0.5' 'git>=2.38' \
&& apk --no-cache add python3 \
&& npm install -g 'pnpm@^7.30'
# Add diretories with necessary config files
COPY pnpm-lock.yaml package.json /opt/client/
# Only install production.
RUN pnpm install --only=prod
COPY build /opt/client/build
COPY src /opt/client/src
COPY config /opt/client/config
COPY .eslintignore pnpm-lock.yaml cypress.config.js .babelrc .eslintrc.js dev.html package.json .postcssrc.js /opt/client/
RUN pnpm build
# 2. Stage: Start server with needed files only
FROM nginx:stable-alpine as production-stage
RUN apk add --no-cache 'openssl>=3.0' 'bash>=5.1' \
&& rm -rf /usr/share/nginx/html/*
USER nginx
COPY --from=build-stage /opt/client/static /usr/share/nginx/html/static
COPY --from=build-stage /opt/client/index.html /usr/share/nginx/html/
COPY templates/nginx.ors-map-client.conf.nginx /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"]
However, I got the NGINX error in docker logs after running the docker container as below:
(also skipped succeeded logs...)
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: can not modify /etc/nginx/conf.d/default.conf (read-only file system?)
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied)
I also tried docker-compose section and natively set up and run part and… failed.
Please tell me if I missed something or if there is anything you do not understand…!