I'm trying to run a script but nodejs can't find python for some reason. I have tried reinstalling python, reinstalling nodejs, reinstalling my OS, running (and rebooting afterwards): export PYTHON="$(which python)"
, export PYTHON="$(which python3)"
(which python does return the right path), npm config set python /usr/bin/python3.9
, npm config set python "/usr/bin/python3.9"
and export PYTHONPATH="$(which python)"
but nothing has worked. I'm running 64 bit lite raspberry OS off a raspberry pi 4. I installed nodejs and python with sudo apt install python/npm/nodejs. Context
Error
The script:
#!/bin/bash
set -xe
cd client
rm -rf .next
yarn
yarn build
cd ..
bash ./bundle-client.sh
docker build --network=host -t clipface:latest .
rm client/docker-bundle.tgz
I tried adding --python="/usr/bin/python3.9" to line 7 and 8 but it makes no difference. I can't add it to line 12 because docker doesn't have a --python switch. Line 12 is when the error occurs
Dockerfile:
FROM node:alpine
# App setup
ADD client/docker-bundle.tgz /
WORKDIR /app
RUN yarn --prod
# Configuration
ENV NODE_CONFIG_DIR=/config
ENV NODE_ENV production
ENV PORT 80
EXPOSE 80
VOLUME /clips
VOLUME /config
CMD yarn start -p ${PORT}
New errors after adding RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
to Dockerfile: https://pastebin.com/eKPZzPSk