juice-shop

Форк
0
/
Dockerfile 
51 строка · 2.0 Кб
1
FROM node:20-buster as installer
2
COPY . /juice-shop
3
WORKDIR /juice-shop
4
RUN npm i -g typescript ts-node
5
RUN npm install --omit=dev --unsafe-perm
6
RUN npm dedupe --omit=dev
7
RUN rm -rf frontend/node_modules
8
RUN rm -rf frontend/.angular
9
RUN rm -rf frontend/src/assets
10
RUN mkdir logs
11
RUN chown -R 65532 logs
12
RUN chgrp -R 0 ftp/ frontend/dist/ logs/ data/ i18n/
13
RUN chmod -R g=u ftp/ frontend/dist/ logs/ data/ i18n/
14
RUN rm data/chatbot/botDefaultTrainingData.json || true
15
RUN rm ftp/legal.md || true
16
RUN rm i18n/*.json || true
17

18
ARG CYCLONEDX_NPM_VERSION=latest
19
RUN npm install -g @cyclonedx/cyclonedx-npm@$CYCLONEDX_NPM_VERSION
20
RUN npm run sbom
21

22
# workaround for libxmljs startup error
23
FROM node:20-buster as libxmljs-builder
24
WORKDIR /juice-shop
25
RUN apt-get update && apt-get install -y build-essential python3
26
COPY --from=installer /juice-shop/node_modules ./node_modules
27
RUN rm -rf node_modules/libxmljs/build && \
28
  cd node_modules/libxmljs && \
29
  npm run build
30

31
FROM gcr.io/distroless/nodejs20-debian11
32
ARG BUILD_DATE
33
ARG VCS_REF
34
LABEL maintainer="Bjoern Kimminich <bjoern.kimminich@owasp.org>" \
35
    org.opencontainers.image.title="OWASP Juice Shop" \
36
    org.opencontainers.image.description="Probably the most modern and sophisticated insecure web application" \
37
    org.opencontainers.image.authors="Bjoern Kimminich <bjoern.kimminich@owasp.org>" \
38
    org.opencontainers.image.vendor="Open Worldwide Application Security Project" \
39
    org.opencontainers.image.documentation="https://help.owasp-juice.shop" \
40
    org.opencontainers.image.licenses="MIT" \
41
    org.opencontainers.image.version="17.1.0" \
42
    org.opencontainers.image.url="https://owasp-juice.shop" \
43
    org.opencontainers.image.source="https://github.com/juice-shop/juice-shop" \
44
    org.opencontainers.image.revision=$VCS_REF \
45
    org.opencontainers.image.created=$BUILD_DATE
46
WORKDIR /juice-shop
47
COPY --from=installer --chown=65532:0 /juice-shop .
48
COPY --chown=65532:0 --from=libxmljs-builder /juice-shop/node_modules/libxmljs ./node_modules/libxmljs
49
USER 65532
50
EXPOSE 3000
51
CMD ["/juice-shop/build/app.js"]
52

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.