2018-07-25 18:48:26 +02:00
|
|
|
FROM node:10.3-alpine as builder
|
2016-05-09 19:19:35 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
RUN apk --no-cache add openssl ca-certificates wget && \
|
2017-12-02 15:15:12 +01: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 18:48:26 +02:00
|
|
|
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
|
2017-12-02 15:15:12 +01:00
|
|
|
apk add glibc-2.25-r0.apk
|
2017-07-04 18:10:41 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
WORKDIR /opt/verdaccio-build
|
|
|
|
COPY . .
|
2017-07-04 18:10:41 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
ENV NODE_ENV=production \
|
|
|
|
VERDACCIO_BUILD_REGISTRY=https://registry.npmjs.org/
|
2017-07-15 21:58:33 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
RUN yarn config set registry $VERDACCIO_BUILD_REGISTRY && \
|
2017-07-18 20:53:37 +02:00
|
|
|
yarn install --production=false && \
|
2018-06-30 19:23:53 +02:00
|
|
|
yarn lint && \
|
|
|
|
yarn code:docker-build && \
|
|
|
|
yarn build:webui && \
|
2017-07-18 20:53:37 +02:00
|
|
|
yarn cache clean && \
|
2017-11-17 09:08:22 +01:00
|
|
|
yarn install --production=true --pure-lockfile
|
2016-05-09 19:19:35 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
FROM node:10.3-alpine
|
|
|
|
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
|
|
|
|
|
|
|
RUN apk --no-cache add openssl dumb-init
|
|
|
|
|
2018-07-18 14:53:08 +02:00
|
|
|
RUN mkdir -p /verdaccio/storage /verdaccio/plugins /verdaccio/conf
|
2017-07-18 20:53:37 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
ENV VERDACCIO_APPDIR=/opt/verdaccio
|
|
|
|
WORKDIR $VERDACCIO_APPDIR
|
|
|
|
|
|
|
|
COPY --from=builder /opt/verdaccio-build .
|
|
|
|
|
2016-05-09 19:19:35 +02:00
|
|
|
ADD conf/docker.yaml /verdaccio/conf/config.yaml
|
|
|
|
|
2018-07-25 18:48:26 +02: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 21:51:18 +01:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
USER $VERDACCIO_USER_UID
|
2017-01-14 21:51:18 +01:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
ENV VERDACCIO_PORT 4873
|
|
|
|
ENV VERDACCIO_PROTOCOL http
|
2017-07-04 18:53:45 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
EXPOSE $VERDACCIO_PORT
|
2016-05-09 19:19:35 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
VOLUME /verdaccio/storage
|
2016-05-09 19:19:35 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
ENTRYPOINT ["uid_entrypoint"]
|
2017-07-04 18:10:41 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
CMD $VERDACCIO_APPDIR/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:${VERDACCIO_PORT}
|