docker-pm2 icon indicating copy to clipboard operation
docker-pm2 copied to clipboard

Add git

Open OmgImAlexis opened this issue 7 years ago • 4 comments

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

OmgImAlexis avatar Nov 30 '17 02:11 OmgImAlexis

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.

simonepri avatar Dec 30 '17 17:12 simonepri

that looks good to me! definitely agree on that!

Unitech avatar Jan 03 '18 14:01 Unitech

Thanks it works

RUN npm install --no-cache git

Maxosys avatar Feb 06 '18 14:02 Maxosys

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" ]

daithi-coombes avatar Jan 09 '19 14:01 daithi-coombes