AndreySenov / firebase-tools-docker

Dockerfile for firebase-tools image
https://hub.docker.com/r/andreysenov/firebase-tools
Other
132 stars 40 forks source link

need python for node-gyp #1

Closed united0202 closed 1 year ago

united0202 commented 5 years ago

Python is required for node-gyp. When I try to install it on myself in "before_scripts", I get an error related to permission. Try different options but overall it looks like this (https://prnt.sc/pwyzq6). I found in the dockerfile that you are changing the user (USER node) . Perhaps that’s why I can’t do anything about it. Could you add a Python or help me solve my problem? Thank you.

AndreySenov commented 5 years ago

Have you considered creating a multistage build?

https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#node-gyp-alpine

united0202 commented 5 years ago

yes, I guess I have a multistage build. Something like this : Sorry, I'm just not competent enough in this, because I definitely can’t tell you.

install backend: stage: install cache: key: BE-$CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR paths:

install frontend: stage: install except: variables:

build backend: stage: build cache: key: BE-$CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR paths:

AndreySenov commented 5 years ago

I decided to create a separate image containing node-gyp and the toolchain since I believe it isn't a good idea to add python to the firebase-tools image. Please try to use this to build your project: https://hub.docker.com/r/andreysenov/node-gyp

AndreySenov commented 1 year ago

Python 3 has been part of the image since the release 12.0.0