2018-07-25 11:48:26 -05:00
|
|
|
FROM node:10.3-alpine as builder
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
RUN apk --no-cache add openssl ca-certificates wget && \
|
2017-12-02 09:15:12 -05:00
|
|
|
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/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
|
|
|
ENV NODE_ENV=production \
|
|
|
|
VERDACCIO_BUILD_REGISTRY=https://registry.npmjs.org/
|
2017-07-15 14:58:33 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
RUN yarn config set registry $VERDACCIO_BUILD_REGISTRY && \
|
2017-07-18 13:53:37 -05:00
|
|
|
yarn install --production=false && \
|
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 && \
|
2017-11-17 03:08:22 -05:00
|
|
|
yarn install --production=true --pure-lockfile
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
|
|
|
|
|
|
|
|
FROM node:10.3-alpine
|
|
|
|
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
|
|
|
|
|
|
|
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
|
|
|
ENV VERDACCIO_APPDIR=/opt/verdaccio
|
|
|
|
WORKDIR $VERDACCIO_APPDIR
|
|
|
|
|
|
|
|
COPY --from=builder /opt/verdaccio-build .
|
|
|
|
|
2016-05-09 12:19:35 -05:00
|
|
|
ADD conf/docker.yaml /verdaccio/conf/config.yaml
|
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
ENV PATH=${VERDACCIO_APPDIR}/bin:${PATH} \
|
|
|
|
HOME=${VERDACCIO_APPDIR} \
|
|
|
|
VERDACCIO_USER_NAME=verdaccio \
|
|
|
|
VERDACCIO_USER_UID=10001
|
|
|
|
|
|
|
|
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 && \
|
|
|
|
chown -R ${VERDACCIO_USER_UID}:root /verdaccio/storage && \
|
|
|
|
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
|
|
|
ENV VERDACCIO_PORT 4873
|
|
|
|
ENV VERDACCIO_PROTOCOL http
|
2017-07-04 11:53:45 -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-25 11:48:26 -05:00
|
|
|
CMD $VERDACCIO_APPDIR/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:${VERDACCIO_PORT}
|