0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/Dockerfile

60 lines
1.8 KiB
Text
Raw Normal View History

FROM node:10.3-alpine as builder
2016-05-09 12:19:35 -05:00
RUN apk --no-cache add openssl ca-certificates wget && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && \
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
apk add glibc-2.25-r0.apk
WORKDIR /opt/verdaccio-build
COPY . .
ENV NODE_ENV=production \
VERDACCIO_BUILD_REGISTRY=https://registry.npmjs.org/
2017-07-15 14:58:33 -05:00
RUN yarn config set registry $VERDACCIO_BUILD_REGISTRY && \
yarn install --production=false && \
2018-06-30 12:23:53 -05:00
yarn lint && \
yarn code:docker-build && \
yarn build:webui && \
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
FROM node:10.3-alpine
LABEL maintainer="https://github.com/verdaccio/verdaccio"
RUN apk --no-cache add openssl dumb-init
RUN mkdir -p /verdaccio/storage /verdaccio/plugins /verdaccio/conf
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
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
USER $VERDACCIO_USER_UID
ENV VERDACCIO_PORT 4873
ENV VERDACCIO_PROTOCOL http
2017-07-04 11:53:45 -05:00
EXPOSE $VERDACCIO_PORT
2016-05-09 12:19:35 -05:00
VOLUME /verdaccio/storage
2016-05-09 12:19:35 -05:00
ENTRYPOINT ["uid_entrypoint"]
CMD $VERDACCIO_APPDIR/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:${VERDACCIO_PORT}