From b55298b97eb49dbb5c0e60d31d478c38b3f2b881 Mon Sep 17 00:00:00 2001 From: Dhanus Date: Tue, 26 Mar 2024 10:00:52 +0530 Subject: [PATCH 1/2] build(docker): add hyperswitch-web, hyperswitch-control-center in docker-compose --- docker-compose.yml | 31 +++++++++++++++++++++++++++++++ docker/web.Dockerfile | 18 ++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 docker/web.Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index e55008f1e34e..4a19347f1122 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -122,6 +122,37 @@ services: labels: logs: "promtail" + hyperswitch-web: + ports: + - "9050:9050" + - "9060:9060" + - "5252:5252" + build: + context: ./docker + dockerfile: web.Dockerfile + networks: + - router_net + environment: + - HYPERSWITCH_SERVER_URL=http://localhost:8080 + depends_on: + hyperswitch-server: + condition: service_started + + hyperswitch-control-center: + image: juspaydotin/hyperswitch-control-center + ports: + - "9000:9000" + networks: + - router_net + environment: + - apiBaseUrl=http://localhost:8080 + - sdkBaseUrl=http://localhost:9050 + depends_on: + hyperswitch-server: + condition: service_started + hyperswitch-web: + condition: service_started + ### Clustered Redis setup redis-cluster: image: redis:7 diff --git a/docker/web.Dockerfile b/docker/web.Dockerfile new file mode 100644 index 000000000000..e5c6fcbf3f6c --- /dev/null +++ b/docker/web.Dockerfile @@ -0,0 +1,18 @@ +FROM node:latest + +RUN npm install concurrently -g + +WORKDIR /app + +RUN git clone https://github.com/juspay/hyperswitch-web . + +RUN sed -i '/hot: true,/a \ host: "0.0.0.0",' webpack.dev.js +RUN sed -i '/hot: true,/a \ host: "0.0.0.0",' Hyperswitch-React-Demo-App/webpack.dev.js + +RUN npm install + +EXPOSE 9050 +EXPOSE 5252 +EXPOSE 9060 + +CMD concurrently "npm run start:dev" "npm run start:playground" From 6517143962ef8e6244bf788fb6620e7376e653e4 Mon Sep 17 00:00:00 2001 From: Dhanus Date: Wed, 27 Mar 2024 08:08:10 +0530 Subject: [PATCH 2/2] fix(infra): environment variables --- docker-compose.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4a19347f1122..9b3a65757488 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -132,8 +132,14 @@ services: dockerfile: web.Dockerfile networks: - router_net + env_file: + - ./.env environment: - - HYPERSWITCH_SERVER_URL=http://localhost:8080 + - HYPERSWITCH_PUBLISHABLE_KEY=$HYPERSWITCH_PUBLISHABLE_KEY + - HYPERSWITCH_SECRET_KEY=$HYPERSWITCH_SECRET_KEY + - HYPERSWITCH_SERVER_URL=${HYPERSWITCH_SERVER_URL:-http://hyperswitch-server:8080} + - HYPERSWITCH_CLIENT_URL=${HYPERSWITCH_CLIENT_URL:-http://hyperswitch-web:9050} + - SELF_SERVER_URL=${SELF_SERVER_URL:-http://hyperswitch-web:5252} depends_on: hyperswitch-server: condition: service_started @@ -145,8 +151,8 @@ services: networks: - router_net environment: - - apiBaseUrl=http://localhost:8080 - - sdkBaseUrl=http://localhost:9050 + - apiBaseUrl=http://hyperswitch-server:8080 + - sdkBaseUrl=http://hyperswitch-web:9050 depends_on: hyperswitch-server: condition: service_started