Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(docker): add web, control-center in docker-compose #4190

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,43 @@ services:
labels:
logs: "promtail"

hyperswitch-web:
ports:
- "9050:9050"
- "9060:9060"
- "5252:5252"
build:
context: ./docker
dockerfile: web.Dockerfile
networks:
- router_net
env_file:
- ./.env
Comment on lines +135 to +136
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide an example of what this .env file would contain? Including placeholder values should be good enough.

environment:
- 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
Comment on lines +143 to +145
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dhanus3133 can you remove this since we want the option to run this along with local server.
i.e using the local cargo run along with docker services for hyperswitch-web & hyperswitch-control-center.


hyperswitch-control-center:
image: juspaydotin/hyperswitch-control-center
ports:
- "9000:9000"
networks:
- router_net
environment:
- apiBaseUrl=http://hyperswitch-server:8080
- sdkBaseUrl=http://hyperswitch-web:9050
Comment on lines +154 to +155
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't work since the communication is initiated via browser here and not via the docker container

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sdkBaseUrl should point to the js assets, in this case it would be sdkBaseUrl=http://<SDK_SERVICE>/HyperLoader.js

depends_on:
hyperswitch-server:
condition: service_started
Comment on lines +157 to +158
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dhanus3133 can you remove this since we want the option to run this along with local server.
i.e using the local cargo run along with docker services for hyperswitch-web & hyperswitch-control-center.

hyperswitch-web:
condition: service_started

### Clustered Redis setup
redis-cluster:
image: redis:7
Expand Down
18 changes: 18 additions & 0 deletions docker/web.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +9 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might not be needed since after this.


RUN npm install

EXPOSE 9050
EXPOSE 5252
EXPOSE 9060

CMD concurrently "npm run start:dev" "npm run start:playground"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this npm command has been removed sometime ago here.

Loading