Skip to content

Commit

Permalink
Added demo dockerfile and deployment yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeisnyk committed Jan 7, 2021
1 parent e7eafbb commit 53b0d29
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 32 deletions.
43 changes: 11 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
FROM node:12 as installer
COPY . /juice-shop
WORKDIR /juice-shop
RUN npm install --production --unsafe-perm
RUN npm dedupe
RUN rm -rf frontend/node_modules
FROM node:8

FROM node:12-alpine
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="Bjoern Kimminich <bjoern.kimminich@owasp.org>" \
org.opencontainers.image.title="OWASP Juice Shop" \
org.opencontainers.image.description="Probably the most modern and sophisticated insecure web application" \
org.opencontainers.image.authors="Bjoern Kimminich <bjoern.kimminich@owasp.org>" \
org.opencontainers.image.vendor="Open Web Application Security Project" \
org.opencontainers.image.documentation="https://help.owasp-juice.shop" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="12.3.0" \
org.opencontainers.image.url="https://owasp-juice.shop" \
org.opencontainers.image.source="https://github.com/bkimminich/juice-shop" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.created=$BUILD_DATE
WORKDIR /juice-shop
RUN addgroup --system --gid 1001 juicer && \
adduser juicer --system --uid 1001 --ingroup juicer
COPY --from=installer --chown=juicer /juice-shop .
RUN mkdir logs && \
chown -R juicer logs && \
chgrp -R 0 ftp/ frontend/dist/ logs/ data/ i18n/ && \
chmod -R g=u ftp/ frontend/dist/ logs/ data/ i18n/
USER 1001
EXPOSE 3000
CMD ["npm", "start"]
RUN mkdir /usr/src/goof
RUN mkdir /tmp/extracted_files
COPY . /usr/src/goof
WORKDIR /usr/src/goof

RUN npm update
RUN npm install
EXPOSE 3001
EXPOSE 9229
ENTRYPOINT ["npm", "start"]
69 changes: 69 additions & 0 deletions privilegedDeployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: snyk-deployment
labels:
app.kubernetes.io/name: snyk-deployment
helm.sh/chart: snyk-deployment-0.1.0
app.kubernetes.io/instance: snyk-deployment
app.kubernetes.io/version: "1.0"
app.kubernetes.io/managed-by: Tiller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: snyk-deployment
app.kubernetes.io/instance: snyk-deployment
template:
metadata:
labels:
app.kubernetes.io/name: snyk-deployment
app.kubernetes.io/instance: snyk-deployment
spec:
hostPID: true
containers:
- name: snyk-deployment1
image: "orka/snyk-deployment:latest"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 5000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
- name: snyk-deployment2
image: "orka/snyk-deployment:latest"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 5000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
# limits:
# cpu: 100
# memory: 100
securityContext:
privileged: true
capabilities:
# drop:
# - all
add:
- CAP_SYS_ADMIN
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock

0 comments on commit 53b0d29

Please sign in to comment.