2019-02-04 02:00:06 -05:00
|
|
|
FROM node:10.15.1-alpine as builder
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2018-07-30 05:08:12 -05:00
|
|
|
ENV NODE_ENV=production \
|
2019-02-04 02:15:20 -05:00
|
|
|
VERDACCIO_BUILD_REGISTRY=https://registry.npmjs.org
|
2018-07-30 05:08:12 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
RUN apk --no-cache add openssl ca-certificates wget && \
|
2018-08-01 15:22:35 -05:00
|
|
|
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python && \
|
2018-08-13 16:27:31 -05:00
|
|
|
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
2018-07-25 11:48:26 -05:00
|
|
|
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
|
2017-12-02 09:15:12 -05:00
|
|
|
apk add glibc-2.25-r0.apk
|
2017-07-04 11:10:41 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
WORKDIR /opt/verdaccio-build
|
|
|
|
COPY . .
|
2017-07-04 11:10:41 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
RUN yarn config set registry $VERDACCIO_BUILD_REGISTRY && \
|
2019-02-04 02:42:51 -05:00
|
|
|
yarn install --production=false --no-lockfile && \
|
2018-06-30 12:23:53 -05:00
|
|
|
yarn lint && \
|
|
|
|
yarn code:docker-build && \
|
|
|
|
yarn build:webui && \
|
2017-07-18 13:53:37 -05:00
|
|
|
yarn cache clean && \
|
2019-02-04 02:42:51 -05:00
|
|
|
yarn install --production=true --no-lockfile
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
|
|
|
|
|
2018-08-01 15:22:35 -05:00
|
|
|
FROM node:10.7-alpine
|
2018-07-25 11:48:26 -05:00
|
|
|
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
|
|
|
|
2018-07-30 05:08:12 -05:00
|
|
|
ENV VERDACCIO_APPDIR=/opt/verdaccio \
|
|
|
|
VERDACCIO_USER_NAME=verdaccio \
|
|
|
|
VERDACCIO_USER_UID=10001 \
|
|
|
|
VERDACCIO_PORT=4873 \
|
|
|
|
VERDACCIO_PROTOCOL=http
|
|
|
|
ENV PATH=$VERDACCIO_APPDIR/docker-bin:$PATH \
|
|
|
|
HOME=$VERDACCIO_APPDIR
|
|
|
|
|
|
|
|
WORKDIR $VERDACCIO_APPDIR
|
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
RUN apk --no-cache add openssl dumb-init
|
|
|
|
|
2018-07-18 07:53:08 -05:00
|
|
|
RUN mkdir -p /verdaccio/storage /verdaccio/plugins /verdaccio/conf
|
2017-07-18 13:53:37 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
COPY --from=builder /opt/verdaccio-build .
|
|
|
|
|
2016-05-09 12:19:35 -05:00
|
|
|
ADD conf/docker.yaml /verdaccio/conf/config.yaml
|
|
|
|
|
2018-07-30 05:08:12 -05:00
|
|
|
RUN adduser -u $VERDACCIO_USER_UID -S -D -h $VERDACCIO_APPDIR -g "$VERDACCIO_USER_NAME user" -s /sbin/nologin $VERDACCIO_USER_NAME && \
|
|
|
|
chmod -R +x $VERDACCIO_APPDIR/bin $VERDACCIO_APPDIR/docker-bin && \
|
|
|
|
chown -R $VERDACCIO_USER_UID:root /verdaccio/storage && \
|
2018-07-25 11:48:26 -05:00
|
|
|
chmod -R g=u /verdaccio/storage /etc/passwd
|
2017-01-14 15:51:18 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
USER $VERDACCIO_USER_UID
|
2017-01-14 15:51:18 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
EXPOSE $VERDACCIO_PORT
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
VOLUME /verdaccio/storage
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
ENTRYPOINT ["uid_entrypoint"]
|
2017-07-04 11:10:41 -05:00
|
|
|
|
2018-07-30 05:08:12 -05:00
|
|
|
CMD $VERDACCIO_APPDIR/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:$VERDACCIO_PORT
|