From 94d801ef1a8f8821d4e85c4bce4d34fe32cb9c59 Mon Sep 17 00:00:00 2001 From: Farhan Angullia Date: Sun, 8 Oct 2023 21:27:58 +0800 Subject: [PATCH 1/6] ci: add releaser --- .github/workflows/releaser.yml | 33 +++++++++++++++++++++++++ .releaserc.json | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/releaser.yml create mode 100644 .releaserc.json diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml new file mode 100644 index 0000000..fbb7046 --- /dev/null +++ b/.github/workflows/releaser.yml @@ -0,0 +1,33 @@ +name: Release + +on: + workflow_dispatch: + push: + branches: + - main + - master + paths: + - 'apps/chaos-playground-ui/**' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + if: github.repository_owner == 'farhanangullia' + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Release + uses: cycjimmy/semantic-release-action@v2 + with: + semantic_version: 18.0.0 + extra_plugins: | + @semantic-release/changelog@6.0.0 + @semantic-release/git@10.0.0 + conventional-changelog-conventionalcommits@4.6.3 + env: + GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..6d072a2 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,45 @@ +{ + "branches": [ + "main", + "master" + ], + "ci": false, + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/github", + { + "successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:", + "labels": false, + "releasedLabels": false + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md", + "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file." + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md" + ], + "message": "chore(release): version ${nextRelease.version} \n\n${nextRelease.notes}" + } + ] + ] + } \ No newline at end of file From d96e232b74727a8d3ea2968396e1c92d838183d6 Mon Sep 17 00:00:00 2001 From: Farhan Angullia Date: Mon, 9 Oct 2023 16:49:23 +0800 Subject: [PATCH 2/6] feat: add support for runtime vars --- apps/chaos-playground-ui/Dockerfile | 38 ++++++++++---------- apps/chaos-playground-ui/public/index.html | 10 ++++++ apps/chaos-playground-ui/src/config/index.js | 23 ++++++------ 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/apps/chaos-playground-ui/Dockerfile b/apps/chaos-playground-ui/Dockerfile index 009cde9..ddbf3a4 100644 --- a/apps/chaos-playground-ui/Dockerfile +++ b/apps/chaos-playground-ui/Dockerfile @@ -1,23 +1,23 @@ FROM public.ecr.aws/docker/library/node:16-alpine as builder -ARG REACT_APP_LIKE_API_BASE_URL -ARG REACT_APP_COUNTER_API_BASE_URL -ARG REACT_APP_CATALOG_API_BASE_URL -ARG REACT_APP_CART_API_BASE_URL -ARG REACT_APP_ORDER_API_BASE_URL -ARG REACT_APP_AUTH0_DOMAIN -ARG REACT_APP_AUTH0_CLIENT_ID -ARG REACT_APP_AUTH0_CALLBACK_URL - -ENV REACT_APP_LIKE_API_BASE_URL=$REACT_APP_LIKE_API_BASE_URL -ENV REACT_APP_COUNTER_API_BASE_URL=$REACT_APP_COUNTER_API_BASE_URL -ENV REACT_APP_CATALOG_API_BASE_URL=$REACT_APP_CATALOG_API_BASE_URL -ENV REACT_APP_CART_API_BASE_URL=$REACT_APP_CART_API_BASE_URL -ENV REACT_APP_ORDER_API_BASE_URL=$REACT_APP_ORDER_API_BASE_URL -ENV REACT_APP_AUTH0_DOMAIN=$REACT_APP_AUTH0_DOMAIN -ENV REACT_APP_AUTH0_CLIENT_ID=$REACT_APP_AUTH0_CLIENT_ID -ENV REACT_APP_AUTH0_CALLBACK_URL=$REACT_APP_AUTH0_CALLBACK_URL -ENV REACT_APP_AUTH0_CALLBACK_URL=$REACT_APP_AUTH0_CALLBACK_URL +# ARG REACT_APP_LIKE_API_BASE_URL +# ARG REACT_APP_COUNTER_API_BASE_URL +# ARG REACT_APP_CATALOG_API_BASE_URL +# ARG REACT_APP_CART_API_BASE_URL +# ARG REACT_APP_ORDER_API_BASE_URL +# ARG REACT_APP_AUTH0_DOMAIN +# ARG REACT_APP_AUTH0_CLIENT_ID +# ARG REACT_APP_AUTH0_CALLBACK_URL + +# ENV REACT_APP_LIKE_API_BASE_URL=$REACT_APP_LIKE_API_BASE_URL +# ENV REACT_APP_COUNTER_API_BASE_URL=$REACT_APP_COUNTER_API_BASE_URL +# ENV REACT_APP_CATALOG_API_BASE_URL=$REACT_APP_CATALOG_API_BASE_URL +# ENV REACT_APP_CART_API_BASE_URL=$REACT_APP_CART_API_BASE_URL +# ENV REACT_APP_ORDER_API_BASE_URL=$REACT_APP_ORDER_API_BASE_URL +# ENV REACT_APP_AUTH0_DOMAIN=$REACT_APP_AUTH0_DOMAIN +# ENV REACT_APP_AUTH0_CLIENT_ID=$REACT_APP_AUTH0_CLIENT_ID +# ENV REACT_APP_AUTH0_CALLBACK_URL=$REACT_APP_AUTH0_CALLBACK_URL +# ENV REACT_APP_AUTH0_CALLBACK_URL=$REACT_APP_AUTH0_CALLBACK_URL WORKDIR /app @@ -41,4 +41,4 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD sed -i '/\/\*ENV_BEGIN\*\/`/r '<(env | grep --color=never "^REACT_APP_") /usr/share/nginx/html; nginx '-g daemon off;' \ No newline at end of file diff --git a/apps/chaos-playground-ui/public/index.html b/apps/chaos-playground-ui/public/index.html index 3ca1533..f5efc95 100644 --- a/apps/chaos-playground-ui/public/index.html +++ b/apps/chaos-playground-ui/public/index.html @@ -21,6 +21,16 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Chaos Playground + diff --git a/apps/chaos-playground-ui/src/config/index.js b/apps/chaos-playground-ui/src/config/index.js index a5ca67b..1c5a91a 100644 --- a/apps/chaos-playground-ui/src/config/index.js +++ b/apps/chaos-playground-ui/src/config/index.js @@ -1,18 +1,17 @@ // Auth -export const AUTH0_DOMAIN = process.env.REACT_APP_AUTH0_DOMAIN; -export const AUTH0_CLIENT_ID = process.env.REACT_APP_AUTH0_CLIENT_ID; -export const AUTH0_CALLBACK_URL = process.env.REACT_APP_AUTH0_CALLBACK_URL; +export const AUTH0_DOMAIN = process.env.REACT_APP_AUTH0_DOMAIN || window.env.REACT_APP_AUTH0_DOMAIN; +export const AUTH0_CLIENT_ID = process.env.REACT_APP_AUTH0_CLIENT_ID || window.env.REACT_APP_AUTH0_CLIENT_ID; +export const AUTH0_CALLBACK_URL = process.env.REACT_APP_AUTH0_CALLBACK_URL || window.env.REACT_APP_AUTH0_CALLBACK_URL; // API -export const LIKE_API_BASE_URL = process.env.REACT_APP_LIKE_API_BASE_URL; -export const COUNTER_API_BASE_URL = process.env.REACT_APP_COUNTER_API_BASE_URL; -export const CATALOG_API_BASE_URL = process.env.REACT_APP_CATALOG_API_BASE_URL; -export const CART_API_BASE_URL = process.env.REACT_APP_CART_API_BASE_URL; -export const ORDER_API_BASE_URL = process.env.REACT_APP_ORDER_API_BASE_URL; +export const LIKE_API_BASE_URL = process.env.REACT_APP_LIKE_API_BASE_URL || window.env.REACT_APP_LIKE_API_BASE_URL; +export const COUNTER_API_BASE_URL = process.env.REACT_APP_COUNTER_API_BASE_URL || window.env.REACT_APP_COUNTER_API_BASE_URL; +export const CATALOG_API_BASE_URL = process.env.REACT_APP_CATALOG_API_BASE_URL || window.env.REACT_APP_CATALOG_API_BASE_URL; +export const CART_API_BASE_URL = process.env.REACT_APP_CART_API_BASE_URL || window.env.REACT_APP_CART_API_BASE_URL; +export const ORDER_API_BASE_URL = process.env.REACT_APP_ORDER_API_BASE_URL || window.env.REACT_APP_ORDER_API_BASE_URL; -let enableAuth = true; -if (AUTH0_DOMAIN === "" || AUTH0_CLIENT_ID === "" || AUTH0_CALLBACK_URL === "") { - enableAuth = false; -} +const enableAuth = [AUTH0_DOMAIN, AUTH0_CLIENT_ID, AUTH0_CALLBACK_URL].every( + (value) => value !== '' && value !== undefined + ); export const AUTH0_ENABLED = enableAuth; \ No newline at end of file From 55c7ae840a6413f8ea635be252160d0b68dc64aa Mon Sep 17 00:00:00 2001 From: Farhan Angullia Date: Mon, 9 Oct 2023 16:52:05 +0800 Subject: [PATCH 3/6] chore: mv examples to deploy dir --- examples/docker/docker-compose.ecommerce.yaml | 98 ------------------- examples/docker/docker-compose.likes.yaml | 68 ------------- examples/docker/docker-compose.tools.yaml | 35 ------- examples/docker/docker-compose.yaml | 24 ----- examples/docker/grafana/grafana.ini | 3 - 5 files changed, 228 deletions(-) delete mode 100644 examples/docker/docker-compose.ecommerce.yaml delete mode 100644 examples/docker/docker-compose.likes.yaml delete mode 100644 examples/docker/docker-compose.tools.yaml delete mode 100644 examples/docker/docker-compose.yaml delete mode 100644 examples/docker/grafana/grafana.ini diff --git a/examples/docker/docker-compose.ecommerce.yaml b/examples/docker/docker-compose.ecommerce.yaml deleted file mode 100644 index 6beaba5..0000000 --- a/examples/docker/docker-compose.ecommerce.yaml +++ /dev/null @@ -1,98 +0,0 @@ -version: "2" -services: - catalog-service: - container_name: catalog-service - hostname: catalog-service - build: - dockerfile: Dockerfile - context: ../../apps/ecommerce-app/catalog-service - restart: unless-stopped - ports: - - "5000:8000" - environment: - - DB_URI=postgresql://postgres:postgres@ecommerce-postgres:5432/postgres - depends_on: - - ecommerce-postgres - networks: - - local-net - - cart-service: - container_name: cart-service - hostname: cart-service - build: - dockerfile: Dockerfile - context: ../../apps/ecommerce-app/cart-service - restart: unless-stopped - ports: - - "7000:8000" - environment: - - REDIS_HOST=ecommerce-redis - - REDIS_PORT=6379 - depends_on: - - ecommerce-postgres - - ecommerce-redis - networks: - - local-net - - order-service: - container_name: order-service - hostname: order-service - build: - dockerfile: Dockerfile - context: ../../apps/ecommerce-app/order-service - restart: unless-stopped - ports: - - "8000:8000" - environment: - - DB_URI=postgresql://postgres:postgres@ecommerce-postgres:5432/postgres - - CART_SERVICE_URL=cart-service:8000 - - PRODUCT_SERVICE_URL=catalog-service:8000 - - SHIPPING_SERVICE_URL=shipping-service:8082 - depends_on: - - ecommerce-postgres - - shipping-service - - catalog-service - - cart-service - networks: - - local-net - - shipping-service: - container_name: shipping-service - hostname: shipping-service - build: - dockerfile: Dockerfile - context: ../../apps/ecommerce-app/shipping-service - restart: unless-stopped - ports: - - "9200:9200" - - "8082:8082" - environment: - - DB_HOST=ecommerce-postgres - - HTTP_PORT=9200 - - GRPC_PORT=8082 - depends_on: - - ecommerce-postgres - networks: - - local-net - - ecommerce-postgres: - container_name: ecommerce-postgres - hostname: ecommerce-postgres - image: postgres:14.7 - restart: unless-stopped - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - ports: - - "5433:5432" - networks: - - local-net - - ecommerce-redis: - container_name: ecommerce-redis - image: redis:7.0.10 - networks: - - local-net - -networks: - local-net: diff --git a/examples/docker/docker-compose.likes.yaml b/examples/docker/docker-compose.likes.yaml deleted file mode 100644 index 7d22c9c..0000000 --- a/examples/docker/docker-compose.likes.yaml +++ /dev/null @@ -1,68 +0,0 @@ - -version: "2" -services: - counter-service: - container_name: counter-service - hostname: counter-service - build: - dockerfile: Dockerfile - context: ../../apps/likes-app/counter-service - restart: unless-stopped - ports: - - "9090:9090" - networks: - - local-net - depends_on: - - likes-redis-server - - like-service: - container_name: like-service - hostname: like-service - build: - dockerfile: Dockerfile - context: ../../apps/likes-app/like-service - restart: unless-stopped - ports: - - "9080:9080" - networks: - - local-net - depends_on: - - likes-postgres - - likes-redis-lock - - likes-postgres: - container_name: likes-postgres - hostname: likes-postgres - image: postgres:14.7 - restart: unless-stopped - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - ports: - - "5432:5432" - volumes: - - ../../apps/likes-app/like-service/db/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql - - ../../apps/likes-app/like-service/db/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql - networks: - - local-net - - likes-redis-server: - container_name: likes-redis-server - hostname: likes-redis-server - image: redis:7.0.10 - ports: - - "6379:6379" - networks: - - local-net - - likes-redis-lock: - container_name: likes-redis-lock - hostname: likes-redis-lock - image: redis:7.0.10 - ports: - - "6479:6379" - networks: - - local-net - -networks: - local-net: \ No newline at end of file diff --git a/examples/docker/docker-compose.tools.yaml b/examples/docker/docker-compose.tools.yaml deleted file mode 100644 index e88fb40..0000000 --- a/examples/docker/docker-compose.tools.yaml +++ /dev/null @@ -1,35 +0,0 @@ -version: "2" -services: - prometheus: - container_name: prometheus - image: prom/prometheus:v2.43.0 - restart: unless-stopped - ports: - - "9050:9090" - command: - - '--config.file=/etc/prometheus/prometheus.yml' - - '--web.enable-lifecycle' - - '--web.enable-remote-write-receiver' - networks: - - local-net - - grafana: - image: grafana/grafana:9.2.15 - container_name: grafana - volumes: - # - ./grafana/provisioning:/etc/grafana/provisioning - - ./grafana:/etc/grafana - environment: - - GF_SECURITY_ADMIN_USER=admin - - GF_SECURITY_ADMIN_PASSWORD=admin - - GF_USERS_ALLOW_SIGN_UP=false - - GF_AUTH_ANONYMOUS_ENABLED=true - - GF_SECURITY_ALLOW_EMBEDDING=true - restart: unless-stopped - ports: - - "3000:3000" - networks: - - local-net - -networks: - local-net: diff --git a/examples/docker/docker-compose.yaml b/examples/docker/docker-compose.yaml deleted file mode 100644 index 3d23dd7..0000000 --- a/examples/docker/docker-compose.yaml +++ /dev/null @@ -1,24 +0,0 @@ -version: "2" -services: - chaos-playground-ui: - container_name: chaos-playground-ui - build: - dockerfile: Dockerfile - context: ../../apps/chaos-playground-ui - args: - - REACT_APP_LIKE_API_BASE_URL=http://localhost:9080 - - REACT_APP_COUNTER_API_BASE_URL=http://localhost:9090 - - REACT_APP_CATALOG_API_BASE_URL=http://localhost:5000 - - REACT_APP_CART_API_BASE_URL=http://localhost:7000 - - REACT_APP_ORDER_API_BASE_URL=http://localhost:8000 - # - REACT_APP_AUTH0_DOMAIN='' # Set value to enable Auth0 - # - REACT_APP_AUTH0_CLIENT_ID='' # Set value to enable Auth0 - # - REACT_APP_AUTH0_CALLBACK_URL='' # Set value to enable Auth0 - restart: unless-stopped - ports: - - 8080:80 - networks: - - local-net - -networks: - local-net: diff --git a/examples/docker/grafana/grafana.ini b/examples/docker/grafana/grafana.ini deleted file mode 100644 index a144cd6..0000000 --- a/examples/docker/grafana/grafana.ini +++ /dev/null @@ -1,3 +0,0 @@ -allow_embedding = true -[auth.anonymous] -enabled = true \ No newline at end of file From c1f2bae0968139ff611efc2e34191b4b4408f20d Mon Sep 17 00:00:00 2001 From: Farhan Angullia Date: Mon, 9 Oct 2023 16:52:24 +0800 Subject: [PATCH 4/6] feat: add compose for ghcr --- deploy/docker/docker-compose.ecommerce.yaml | 90 +++++++++++++++++++++ deploy/docker/docker-compose.likes.yaml | 64 +++++++++++++++ deploy/docker/docker-compose.tools.yaml | 35 ++++++++ deploy/docker/docker-compose.yaml | 23 ++++++ deploy/docker/grafana/grafana.ini | 3 + 5 files changed, 215 insertions(+) create mode 100644 deploy/docker/docker-compose.ecommerce.yaml create mode 100644 deploy/docker/docker-compose.likes.yaml create mode 100644 deploy/docker/docker-compose.tools.yaml create mode 100644 deploy/docker/docker-compose.yaml create mode 100644 deploy/docker/grafana/grafana.ini diff --git a/deploy/docker/docker-compose.ecommerce.yaml b/deploy/docker/docker-compose.ecommerce.yaml new file mode 100644 index 0000000..bdff772 --- /dev/null +++ b/deploy/docker/docker-compose.ecommerce.yaml @@ -0,0 +1,90 @@ +version: "2" +services: + catalog-service: + container_name: catalog-service + hostname: catalog-service + image: ghcr.io/farhanangullia/ecommerce-app/catalog-service:v1.0.0 + restart: unless-stopped + ports: + - "5000:8000" + environment: + - DB_URI=postgresql://postgres:postgres@ecommerce-postgres:5432/postgres + depends_on: + - ecommerce-postgres + networks: + - local-net + + cart-service: + container_name: cart-service + hostname: cart-service + image: ghcr.io/farhanangullia/ecommerce-app/cart-service:v1.0.0 + restart: unless-stopped + ports: + - "7000:8000" + environment: + - REDIS_HOST=ecommerce-redis + - REDIS_PORT=6379 + depends_on: + - ecommerce-postgres + - ecommerce-redis + networks: + - local-net + + order-service: + container_name: order-service + hostname: order-service + image: ghcr.io/farhanangullia/ecommerce-app/order-service:v1.0.0 + restart: unless-stopped + ports: + - "8000:8000" + environment: + - DB_URI=postgresql://postgres:postgres@ecommerce-postgres:5432/postgres + - CART_SERVICE_URL=cart-service:8000 + - PRODUCT_SERVICE_URL=catalog-service:8000 + - SHIPPING_SERVICE_URL=shipping-service:8082 + depends_on: + - ecommerce-postgres + - shipping-service + - catalog-service + - cart-service + networks: + - local-net + + shipping-service: + container_name: shipping-service + hostname: shipping-service + image: ghcr.io/farhanangullia/ecommerce-app/shipping-service:v1.0.0 + restart: unless-stopped + ports: + - "9200:9200" + - "8082:8082" + environment: + - DB_HOST=ecommerce-postgres + - HTTP_PORT=9200 + - GRPC_PORT=8082 + depends_on: + - ecommerce-postgres + networks: + - local-net + + ecommerce-postgres: + container_name: ecommerce-postgres + hostname: ecommerce-postgres + image: postgres:14.7 + restart: unless-stopped + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + ports: + - "5433:5432" + networks: + - local-net + + ecommerce-redis: + container_name: ecommerce-redis + image: redis:7.0.10 + networks: + - local-net + +networks: + local-net: diff --git a/deploy/docker/docker-compose.likes.yaml b/deploy/docker/docker-compose.likes.yaml new file mode 100644 index 0000000..ac1582c --- /dev/null +++ b/deploy/docker/docker-compose.likes.yaml @@ -0,0 +1,64 @@ + +version: "2" +services: + counter-service: + container_name: counter-service + hostname: counter-service + image: ghcr.io/farhanangullia/likes-app/counter-service:v1.0.0 + restart: unless-stopped + ports: + - "9090:9090" + networks: + - local-net + depends_on: + - likes-redis-server + + like-service: + container_name: like-service + hostname: like-service + image: ghcr.io/farhanangullia/likes-app/like-service:v1.0.0 + restart: unless-stopped + ports: + - "9080:9080" + networks: + - local-net + depends_on: + - likes-postgres + - likes-redis-lock + + likes-postgres: + container_name: likes-postgres + hostname: likes-postgres + image: postgres:14.7 + restart: unless-stopped + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + ports: + - "5432:5432" + volumes: + - ../../apps/likes-app/like-service/db/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql + - ../../apps/likes-app/like-service/db/fill_tables.sql:/docker-entrypoint-initdb.d/fill_tables.sql + networks: + - local-net + + likes-redis-server: + container_name: likes-redis-server + hostname: likes-redis-server + image: redis:7.0.10 + ports: + - "6379:6379" + networks: + - local-net + + likes-redis-lock: + container_name: likes-redis-lock + hostname: likes-redis-lock + image: redis:7.0.10 + ports: + - "6479:6379" + networks: + - local-net + +networks: + local-net: \ No newline at end of file diff --git a/deploy/docker/docker-compose.tools.yaml b/deploy/docker/docker-compose.tools.yaml new file mode 100644 index 0000000..e88fb40 --- /dev/null +++ b/deploy/docker/docker-compose.tools.yaml @@ -0,0 +1,35 @@ +version: "2" +services: + prometheus: + container_name: prometheus + image: prom/prometheus:v2.43.0 + restart: unless-stopped + ports: + - "9050:9090" + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--web.enable-lifecycle' + - '--web.enable-remote-write-receiver' + networks: + - local-net + + grafana: + image: grafana/grafana:9.2.15 + container_name: grafana + volumes: + # - ./grafana/provisioning:/etc/grafana/provisioning + - ./grafana:/etc/grafana + environment: + - GF_SECURITY_ADMIN_USER=admin + - GF_SECURITY_ADMIN_PASSWORD=admin + - GF_USERS_ALLOW_SIGN_UP=false + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_SECURITY_ALLOW_EMBEDDING=true + restart: unless-stopped + ports: + - "3000:3000" + networks: + - local-net + +networks: + local-net: diff --git a/deploy/docker/docker-compose.yaml b/deploy/docker/docker-compose.yaml new file mode 100644 index 0000000..c40cdd0 --- /dev/null +++ b/deploy/docker/docker-compose.yaml @@ -0,0 +1,23 @@ +version: "2" +services: + chaos-playground-ui: + container_name: chaos-playground-ui + hostname: chaos-playground-ui + image: ghcr.io/farhanangullia/chaos-playground/chaos-playground-ui:v1.0.0 + restart: unless-stopped + environment: + - REACT_APP_LIKE_API_BASE_URL=http://localhost:9080 + - REACT_APP_COUNTER_API_BASE_URL=http://localhost:9090 + - REACT_APP_CATALOG_API_BASE_URL=http://localhost:5000 + - REACT_APP_CART_API_BASE_URL=http://localhost:7000 + - REACT_APP_ORDER_API_BASE_URL=http://localhost:8000 + # - REACT_APP_AUTH0_DOMAIN='' # Set value to enable Auth0 + # - REACT_APP_AUTH0_CLIENT_ID='' # Set value to enable Auth0 + # - REACT_APP_AUTH0_CALLBACK_URL='' # Set value to enable Auth0 + ports: + - 8080:80 + networks: + - local-net + +networks: + local-net: diff --git a/deploy/docker/grafana/grafana.ini b/deploy/docker/grafana/grafana.ini new file mode 100644 index 0000000..a144cd6 --- /dev/null +++ b/deploy/docker/grafana/grafana.ini @@ -0,0 +1,3 @@ +allow_embedding = true +[auth.anonymous] +enabled = true \ No newline at end of file From 59e46322dc5f4e832923a31e156431d54398dc71 Mon Sep 17 00:00:00 2001 From: Farhan Angullia Date: Mon, 9 Oct 2023 16:52:44 +0800 Subject: [PATCH 5/6] ci: update makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 558ce15..a5e7ae5 100644 --- a/Makefile +++ b/Makefile @@ -9,11 +9,11 @@ update: .PHONY: start start: - docker-compose -p chaos-playground -f examples/docker/docker-compose.yaml -f examples/docker/docker-compose.tools.yaml -f examples/docker/docker-compose.likes.yaml -f examples/docker/docker-compose.ecommerce.yaml up -d --build + docker-compose -p chaos-playground -f deploy/docker/docker-compose.yaml -f deploy/docker/docker-compose.tools.yaml -f deploy/docker/docker-compose.likes.yaml -f deploy/docker/docker-compose.ecommerce.yaml up -d --build .PHONY: stop stop: - docker-compose -p chaos-playground -f examples/docker/docker-compose.yaml -f examples/docker/docker-compose.tools.yaml -f examples/docker/docker-compose.likes.yaml -f examples/docker/docker-compose.ecommerce.yaml down --remove-orphans + docker-compose -p chaos-playground -f deploy/docker/docker-compose.yaml -f deploy/docker/docker-compose.tools.yaml -f deploy/docker/docker-compose.likes.yaml -f deploy/docker/docker-compose.ecommerce.yaml down --remove-orphans .PHONY: tools tools: @@ -34,7 +34,7 @@ env: sudo systemctl enable nginx sudo systemctl start nginx sudo systemctl status nginx - cd /opt && git clone https://github.com/farhanangullia/chaos-playground.git && cd chaos-playground && make init && docker-compose -p chaos-playground -f examples/docker/docker-compose.likes.yaml -f examples/docker/docker-compose.ecommerce.yaml up -d --build + cd /opt && git clone https://github.com/farhanangullia/chaos-playground.git && cd chaos-playground && make init && docker-compose -p chaos-playground -f deploy/docker/docker-compose.likes.yaml -f deploy/docker/docker-compose.ecommerce.yaml up -d cp -f /opt/chaos-playground/reverse-proxy.conf /etc/nginx/nginx.conf sudo service nginx restart From a58ea6afdbe4834453b7fbf56663f58ce658d79f Mon Sep 17 00:00:00 2001 From: Farhan Angullia Date: Mon, 9 Oct 2023 16:52:55 +0800 Subject: [PATCH 6/6] docs: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 982bf5f..c76bfb0 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Try the app: [Chaos Playground](https://chaosplayground.netlify.app) ## 🛠️ Installation Steps ### Docker -> **_NOTE:_** By default, Auth is disabled. Set Auth0 values in examples/docker/docker-compose.yaml to enable auth for accessing the apps. +> **_NOTE:_** By default, Auth is disabled. Set Auth0 values in deploy/docker/docker-compose.yaml to enable auth for accessing the apps. Clone repository: ```