docker-pm2
docker-pm2 copied to clipboard
Add git
It'd be nice if the containers had git support added so packages can be installed from git addresses.
Ref: https://github.com/npm/npm/issues/17985
Hello @OmgImAlexis, thank you for opening the issue!
I think it's a pretty reasonable request.
We just need to add something like this:
RUN apk update && apk upgrade && apk add --no-cache git
@Unitech I think it can be useful for who has packages that are not available on npm (like private packages). I'm only concerned about the size increase of the image.
that looks good to me! definitely agree on that!
Thanks it works
RUN npm install --no-cache git
Generally there is a that needs git
, or at least g++
, make
etc. I've added suggestions from https://github.com/nodejs/docker-node/issues/282#issuecomment-358907790 to my Dockerfile
:
Note: this greatly increases build time, so maybe blocker for the auto-builds. So maybe solution is to put it in documentation for if needed
cases? (documentation link: https://pm2.io/doc/en/runtime/integration/docker/#using-pm2-with-docker)
FROM keymetrics/pm2:latest-alpine
# Bundle APP files
COPY app src/
COPY app/package.json .
COPY ecosystem.config.js .
# stick with parent version of alpine, don't update/upgrade
RUN apk --no-cache --virtual build-dependencies add \
python \
make \
g++ \
git
# Install app dependencies
ENV NPM_CONFIG_LOGLEVEL warn
RUN npm install --production \
&& apk del build-dependencies
# Expose the listening port of your app
EXPOSE 3004
# Show current folder structure in logs
RUN ls -al -R
CMD [ "pm2-runtime", "start", "ecosystem.config.js" ]