2021-10-15 18:49:47 +02:00
|
|
|
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.18.1-alpine as builder
|
2016-05-09 19:19:35 +02:00
|
|
|
|
2020-08-11 07:21:51 +02:00
|
|
|
ENV NODE_ENV=development \
|
2019-08-18 07:50:42 +02:00
|
|
|
VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org
|
2018-07-30 12:08:12 +02:00
|
|
|
|
2018-07-25 18:48:26 +02:00
|
|
|
RUN apk --no-cache add openssl ca-certificates wget && \
|
2018-08-01 22:22:35 +02:00
|
|
|
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python && \
|
2018-08-13 23:27:31 +02:00
|
|
|
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/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
|
|
|
|
2021-07-27 21:59:22 +02:00
|
|
|
RUN npm -g i pnpm@6.10.3 && \
|
2020-08-11 07:21:51 +02:00
|
|
|
pnpm config set registry $VERDACCIO_BUILD_REGISTRY && \
|
2020-09-17 06:48:16 +02:00
|
|
|
pnpm recursive install --frozen-lockfile --ignore-scripts && \
|
2020-12-30 22:25:27 +01:00
|
|
|
pnpm run build
|
|
|
|
# FIXME: need to remove devDependencies from the build
|
|
|
|
# RUN pnpm install --prod --ignore-scripts
|
2016-05-09 19:19:35 +02:00
|
|
|
|
2021-10-15 18:49:47 +02:00
|
|
|
FROM node:14.18.1-alpine
|
2018-07-25 18:48:26 +02:00
|
|
|
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
|
|
|
|
2018-07-30 12:08:12 +02: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 18:48:26 +02:00
|
|
|
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
|
|
|
COPY --from=builder /opt/verdaccio-build .
|
|
|
|
|
2020-03-03 23:59:19 +01:00
|
|
|
RUN ls packages/config/src/conf
|
|
|
|
ADD packages/config/src/conf/docker.yaml /verdaccio/conf/config.yaml
|
2016-05-09 19:19:35 +02:00
|
|
|
|
2018-07-30 12:08:12 +02:00
|
|
|
RUN adduser -u $VERDACCIO_USER_UID -S -D -h $VERDACCIO_APPDIR -g "$VERDACCIO_USER_NAME user" -s /sbin/nologin $VERDACCIO_USER_NAME && \
|
2020-03-03 23:59:19 +01:00
|
|
|
chmod -R +x $VERDACCIO_APPDIR/packages/verdaccio/bin $VERDACCIO_APPDIR/docker-bin && \
|
2018-07-30 12:08:12 +02:00
|
|
|
chown -R $VERDACCIO_USER_UID:root /verdaccio/storage && \
|
2018-07-25 18:48:26 +02:00
|
|
|
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
|
|
|
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
|
|
|
|
2020-03-03 23:59:19 +01:00
|
|
|
CMD $VERDACCIO_APPDIR/packages/verdaccio/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:$VERDACCIO_PORT
|