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

62 lines
2.2 KiB
Text
Raw Normal View History

2024-07-15 16:59:12 -05:00
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:21-alpine AS builder
2016-05-09 12:19:35 -05:00
ENV NODE_ENV=development \
VERDACCIO_BUILD_REGISTRY=https://registry.npmjs.org
RUN apk --no-cache add openssl ca-certificates wget && \
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python3 && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
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
WORKDIR /opt/verdaccio-build
COPY . .
2024-07-14 13:10:08 -05:00
RUN npm -g i pnpm@8.14.0 && \
pnpm config set registry $VERDACCIO_BUILD_REGISTRY && \
2023-04-12 14:49:24 -05:00
pnpm install --frozen-lockfile --ignore-scripts && \
rm -Rf test && \
pnpm run build
# FIXME: need to remove devDependencies from the build
# NODE_ENV=production pnpm install --frozen-lockfile --ignore-scripts
# RUN pnpm install --prod --ignore-scripts
2016-05-09 12:19:35 -05:00
2023-10-28 10:52:57 -05:00
FROM node:21-alpine
LABEL maintainer="https://github.com/verdaccio/verdaccio"
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
RUN apk --no-cache add openssl dumb-init
RUN mkdir -p /verdaccio/storage /verdaccio/plugins /verdaccio/conf
COPY --from=builder /opt/verdaccio-build .
2020-03-03 17:59:19 -05:00
RUN ls packages/config/src/conf
2024-07-14 13:10:08 -05:00
ADD config.yaml /verdaccio/conf/config.yaml
ADD abappm /verdaccio/abappm
2016-05-09 12:19:35 -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 && \
chown -R $VERDACCIO_USER_UID:root /verdaccio/storage && \
chmod -R g=u /verdaccio/storage /etc/passwd
USER $VERDACCIO_USER_UID
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"]
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
2024-07-16 18:19:00 -05:00
HEALTHCHECK --interval=5s --timeout=1s CMD /verdaccio/abappm/healthcheck.sh