2023-02-20 01:19:47 -05:00
|
|
|
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:18-alpine as builder
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2020-08-11 00:21:51 -05:00
|
|
|
ENV NODE_ENV=development \
|
2023-04-17 00:14:00 -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 && \
|
2022-07-12 15:30:06 -05:00
|
|
|
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python3 && \
|
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 && \
|
2022-11-20 04:36:26 -05:00
|
|
|
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk && \
|
|
|
|
apk add --force-overwrite glibc-2.35-r0.apk
|
2017-07-04 11:10:41 -05:00
|
|
|
|
2018-07-25 11:48:26 -05:00
|
|
|
WORKDIR /opt/verdaccio-build
|
|
|
|
COPY . .
|
2023-10-27 00:31:06 -05:00
|
|
|
RUN npm -g i pnpm@8.9.0 && \
|
2020-08-11 00:21:51 -05:00
|
|
|
pnpm config set registry $VERDACCIO_BUILD_REGISTRY && \
|
2023-04-12 14:49:24 -05:00
|
|
|
pnpm install --frozen-lockfile --ignore-scripts && \
|
2021-11-20 01:46:35 -05:00
|
|
|
rm -Rf test && \
|
2023-04-17 00:14:00 -05:00
|
|
|
pnpm run build
|
|
|
|
# FIXME: need to remove devDependencies from the build
|
|
|
|
# NODE_ENV=production pnpm install --frozen-lockfile --ignore-scripts
|
2020-12-30 16:25:27 -05:00
|
|
|
# RUN pnpm install --prod --ignore-scripts
|
2016-05-09 12:19:35 -05:00
|
|
|
|
2023-02-20 01:19:47 -05:00
|
|
|
FROM node:18-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 .
|
|
|
|
|
2020-03-03 17:59:19 -05:00
|
|
|
RUN ls packages/config/src/conf
|
|
|
|
ADD packages/config/src/conf/docker.yaml /verdaccio/conf/config.yaml
|
2016-05-09 12:19:35 -05:00
|
|
|
|
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 && \
|
2020-03-03 17:59:19 -05:00
|
|
|
chmod -R +x $VERDACCIO_APPDIR/packages/verdaccio/bin $VERDACCIO_APPDIR/docker-bin && \
|
2018-07-30 05:08:12 -05:00
|
|
|
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
|
|
|
|
2020-03-03 17:59:19 -05:00
|
|
|
CMD $VERDACCIO_APPDIR/packages/verdaccio/bin/verdaccio --config /verdaccio/conf/config.yaml --listen $VERDACCIO_PROTOCOL://0.0.0.0:$VERDACCIO_PORT
|