From 52d9c51e6908f38aaed252015326ba3db795592e Mon Sep 17 00:00:00 2001 From: loopsun <19802021245@139.com> Date: Wed, 9 Oct 2019 11:55:41 +0800 Subject: [PATCH 1/2] Feature: added docker support --- .dockerignore | 4 ++++ .gitignore | 1 + Dockerfile | 12 ++++++++++++ README.md | 8 ++++++++ buildDocker.sh | 8 ++++++++ docker-compose.yml | 8 ++++++++ 6 files changed, 41 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 buildDocker.sh create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..31a5702d63 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +npm-debug.log +.github +tests diff --git a/.gitignore b/.gitignore index e546c94925..f5618c724c 100755 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ npm-debug.log travis.log build .vscode +.idea .*.swp .DS_Store src/core/config/modules/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..89975aec9f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# build a small nginx image with built app +FROM nginx + +## Remove default nginx website +RUN rm -rf /usr/share/nginx/html/* + +## From 'build' copy website to default nginx public folder +COPY ./build/prod /usr/share/nginx/html + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index d79c99a98e..ee36336dcb 100755 --- a/README.md +++ b/README.md @@ -21,6 +21,14 @@ Cryptographic operations in CyberChef should not be relied upon to provide secur [A live demo can be found here][1] - have fun! +## Quick start with docker-compose +``` +git clone https://github.com/gchq/CyberChef.git && cd CyberChef +docker-compose up -d +``` + +open this address in your browser: _http://localhost:8080/_ + ## How it works diff --git a/buildDocker.sh b/buildDocker.sh new file mode 100755 index 0000000000..9d2d121939 --- /dev/null +++ b/buildDocker.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# build latest image +grunt prod + +docker build -t loopsun/cyberchef:latest . + +docker push loopsun/cyberchef:latest diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..7fd1cfe911 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '2.0' + +services: + cyberchef: + restart: always + image: loopsun/cyberchef:latest + ports: + - 8080:80 From 9e1e742176451e1e7f3b806cb05b3137e2b1ed8e Mon Sep 17 00:00:00 2001 From: loopsun <50225144+ButterflyTech@users.noreply.github.com> Date: Fri, 11 Oct 2019 23:36:47 +0800 Subject: [PATCH 2/2] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 89975aec9f..f906398c75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM nginx ## Remove default nginx website RUN rm -rf /usr/share/nginx/html/* -## From 'build' copy website to default nginx public folder +## From 'build' directory copy website to default nginx public folder COPY ./build/prod /usr/share/nginx/html EXPOSE 80