From 9bc1d00e3136271f05a7a6b0d94f0d7dbc89d009 Mon Sep 17 00:00:00 2001 From: Mike Cunningham Date: Tue, 12 Sep 2023 11:02:54 -0700 Subject: [PATCH 1/4] Update docker-compose.md (#501) fix path error for restAPI image --- docs/docker-compose.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/docker-compose.md b/docs/docker-compose.md index 23e3c584..263b2195 100644 --- a/docs/docker-compose.md +++ b/docs/docker-compose.md @@ -36,10 +36,12 @@ docker-compose up This command will build all of the necessary Docker images and run the corresponding Docker containers. ### Using pre-built images -1. Use the following commands to pull the images from the Github Container Registry. Replace the image tag with the version number you are using. +1. Use the following commands to pull the images from the Github Container Registry. Replace the image tag with the version number you are using. If no image is specified, `latest` will be pulled. ``` docker pull ghcr.io/center-for-threat-informed-defense/attack-workbench-frontend: -docker pull ghcr.io/center-for-threat-informed-defense/attack-workbench-frontend-rest-api: +``` +``` +docker pull ghcr.io/center-for-threat-informed-defense/attack-workbench-rest-api: ``` 2. Navigate to the `attack-workbench-frontend` directory, and modify the `docker-compose.yml` file. Replace the `build` attribute with the corresponding `image`. ``` From d4b0db276c6b175061f353e3db04559a68beacf0 Mon Sep 17 00:00:00 2001 From: Charissa Miller <48832936+clemiller@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:02:04 -0400 Subject: [PATCH 2/4] Update changelog.md --- docs/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 2d3990a0..675ee3aa 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -32,7 +32,7 @@ # Changelog -## Changes Staged on Develop +## 21 September 2023 ### ATT&CK Workbench version 2.0.1 From 4cd460d1226d8a313e2c6b365736d9489a6a2745 Mon Sep 17 00:00:00 2001 From: Maurizio Casciano Date: Tue, 14 Nov 2023 10:34:23 +0100 Subject: [PATCH 3/4] Fix #517 Configurable Docker Compose exposed ports --- docker-compose.yml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ed5533f1..e97618a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,37 +3,43 @@ services: frontend: container_name: attack-workbench-frontend build: . + environment: + FRONTEND_PORT: "${FRONTEND_PORT:-80}" depends_on: - rest-api ports: - - "80:80" + - "${FRONTEND_PORT:-80}:80" volumes: - ./docker-compose-resources/nginx/nginx.conf:/etc/nginx/nginx.conf:ro rest-api: container_name: attack-workbench-rest-api build: ../attack-workbench-rest-api + environment: + BACKEND_PORT: "${BACKEND_PORT:-3000}" + DATABASE_URL: "mongodb://attack-workbench-database:${DATABASE_PORT:-27017}/attack-workspace" + SERVICE_ACCOUNT_APIKEY_ENABLE: "true" + JSON_CONFIG_PATH: "./resources/rest-api-service-config.json" + WORKBENCH_HOST: "http://attack-workbench-rest-api" + WORKBENCH_AUTHN_SERVICE_NAME: "collection-manager" + WORKBENCH_AUTHN_APIKEY: "sample-key" depends_on: - mongodb ports: - - "3000:3000" + - "${BACKEND_PORT:-3000}:3000" volumes: - ./docker-compose-resources/rest-api/rest-api-service-config.json:/usr/src/app/resources/rest-api-service-config.json:ro - environment: - - DATABASE_URL=mongodb://attack-workbench-database/attack-workspace - - SERVICE_ACCOUNT_APIKEY_ENABLE=true - - JSON_CONFIG_PATH=./resources/rest-api-service-config.json - - WORKBENCH_HOST=http://attack-workbench-rest-api - - WORKBENCH_AUTHN_SERVICE_NAME=collection-manager - - WORKBENCH_AUTHN_APIKEY=sample-key mongodb: container_name: attack-workbench-database image: mongo + environment: + DATABASE_PORT: "${DATABASE_PORT:-27017}" + ports: + - "${DATABASE_PORT:-27017}:${DATABASE_PORT:-27017}" volumes: - db-data:/data/db - ports: - - "27017:27017" - + command: "mongod --port ${DATABASE_PORT:-27017}" + volumes: db-data: From 8aa342966e83e32d18ea9f6dd6e5ac51691a31c8 Mon Sep 17 00:00:00 2001 From: Maurizio Casciano Date: Tue, 14 Nov 2023 10:38:53 +0100 Subject: [PATCH 4/4] Add rest-api DATABASE_PORT: "${DATABASE_PORT:-27017}" --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index e97618a0..fcad705f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,7 @@ services: build: ../attack-workbench-rest-api environment: BACKEND_PORT: "${BACKEND_PORT:-3000}" + DATABASE_PORT: "${DATABASE_PORT:-27017}" DATABASE_URL: "mongodb://attack-workbench-database:${DATABASE_PORT:-27017}/attack-workspace" SERVICE_ACCOUNT_APIKEY_ENABLE: "true" JSON_CONFIG_PATH: "./resources/rest-api-service-config.json"