forked from alexeisnyk/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added demo dockerfile and deployment yaml
- Loading branch information
1 parent
e7eafbb
commit 53b0d29
Showing
2 changed files
with
80 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |