Skip to content

Commit 5ea5f74

Browse files
committed
1 parent 94e9715 commit 5ea5f74

1 file changed

Lines changed: 18 additions & 26 deletions

File tree

Dockerfile

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,34 @@
1-
FROM verdaccio/verdaccio:4.6.2 as builder
1+
FROM node:12.16.3-alpine3.11 as builder
22

3-
ENV NODE_ENV=production \
4-
VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org
5-
6-
USER root
3+
WORKDIR /opt/verdaccio-gitlab-build
74

8-
RUN apk --no-cache add openssl ca-certificates wget && \
9-
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers git make python && \
10-
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
11-
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
12-
apk add glibc-2.25-r0.apk
5+
RUN apk --no-cache add git openssh
6+
RUN git clone https://github.com/bufferoverflow/verdaccio-gitlab.git .
137

14-
WORKDIR /opt/verdaccio-build
8+
ENV NODE_ENV=production \
9+
VERDACCIO_BUILD_REGISTRY=https://registry.npmjs.org/
1510

16-
RUN git clone https://github.com/bufferoverflow/verdaccio-gitlab.git && \
17-
cd verdaccio-gitlab && \
18-
yarn config set registry $VERDACCIO_BUILD_REGISTRY && \
11+
RUN yarn config set registry $VERDACCIO_BUILD_REGISTRY && \
1912
yarn install --production=false && \
2013
yarn code:docker-build && \
2114
yarn cache clean && \
2215
yarn install --production=true --pure-lockfile
2316

24-
FROM verdaccio/verdaccio:4.6.2
2517

26-
LABEL maintainer="https://github.com/verdaccio/verdaccio"
2718

28-
ENV VERDACCIO_APPDIR=/opt/verdaccio \
29-
VERDACCIO_USER_NAME=verdaccio \
30-
VERDACCIO_USER_UID=10001 \
31-
VERDACCIO_PORT=4873 \
32-
VERDACCIO_PROTOCOL=http
33-
ENV PATH=$VERDACCIO_APPDIR/docker-bin:$PATH \
34-
HOME=$VERDACCIO_APPDIR
19+
FROM verdaccio/verdaccio:4.6.2
20+
LABEL maintainer="https://github.com/bufferoverflow/verdaccio-gitlab"
3521

36-
WORKDIR $VERDACCIO_APPDIR
22+
# Go back to root to be able to install the plugin
23+
USER root
3724

38-
RUN npm install -g verdaccio-gitlab
25+
COPY --from=builder /opt/verdaccio-gitlab-build/build /opt/verdaccio-gitlab/build
26+
COPY --from=builder /opt/verdaccio-gitlab-build/package.json /opt/verdaccio-gitlab/package.json
27+
COPY --from=builder /opt/verdaccio-gitlab-build/node_modules /opt/verdaccio-gitlab/node_modules
3928

40-
COPY --from=builder /opt/verdaccio-build/verdaccio-gitlab/build /verdaccio/plugins/verdaccio-gitlab
29+
# Inherited from parent image
30+
WORKDIR $VERDACCIO_APPDIR
31+
RUN ln -s /opt/verdaccio-gitlab/build /verdaccio/plugins/verdaccio-gitlab
4132

33+
# Inherited from parent image
4234
USER $VERDACCIO_USER_UID

0 commit comments

Comments
 (0)