-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 client and control center services to docker compose setup #4197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test the changes in this PR? How does the setup process look like?
Yes, I have tested changes locally by following |
If you're seeing only the text on the page, then the setup in incomplete, you should be able to see a demo store on the left, and a form to enter card details on the right as well, if you set it up correctly. Could you open the network tab in the browser developer tools and fix any problems that you notice? |
@SanchithHegde Thank you for guiding me in the right direction. - HYPERSWITCH_PUBLISHABLE_KEY=PUBLISHABLE_KEY
- HYPERSWITCH_SECRET_KEY=SECRET_KEY
- HYPERSWITCH_SERVER_URL=http://hyperswitch-server:8080
- HYPERSWITCH_CLIENT_URL=http://hyperswitch-web:9050
- SELF_SERVER_URL=http://hyperswitch-web:5252 For HYPERWITCH_PUBLISHABLE_KEY and HYPERWITCH_SECRET_KEY, I've followed the steps mentioned in the documentation and generated the keys. |
To set up, create a
Then execute |
Could you please include screenshots for the same? |
@SanchithHegde I got the card details in right hand side now. |
Hello @SanchithHegde can you review the changes? |
docker/web.Dockerfile
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still needed after this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
docker-compose.yml
Outdated
|
||
### Control Center | ||
hyperswitch-control-center: | ||
image: juspaydotin/hyperswitch-control-center |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use the latest
tag here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, will make the changes
docker/web.Dockerfile
Outdated
EXPOSE 5252 | ||
EXPOSE 9060 | ||
|
||
CMD concurrently "npm run re:start" "npm run start" "npm run start:playground" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vsrivatsa-juspay can you check this one?
it seems that npm run re:start
does the compilation and needs to be completed before the other 2 commands are executed...
also would prefer npm run re:build
instead on npm run re:start
since we don't need the hot reloading here...
docker-compose.yml
Outdated
networks: | ||
- router_net |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might not be needed since there isn't any inter-service communication happening here...
since all communication happens on the host machine and is initiated by browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
docker-compose.yml
Outdated
networks: | ||
- router_net |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might not be needed since there isn't any inter-service communication happening here...
since all communication happens on the host machine and is initiated by browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes,
also can you share a screenshot of the SDK loading locally (inside the control-center) as shown in the reference screenshot from sandbox
docker/web.Dockerfile
Outdated
EXPOSE 5252 | ||
EXPOSE 9060 | ||
|
||
CMD concurrently "npm run re:build" "npm run start" "npm run start:playground" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMD concurrently "npm run re:build" "npm run start" "npm run start:playground" | |
CMD concurrently "npm run re:build && npm run start" "npm run start:playground" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion.
docker-compose.yml
Outdated
context: ./docker | ||
dockerfile: web.Dockerfile | ||
env_file: | ||
- ./.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prasad89 Can you make sure the SDK loads in control-center
sharing a reference screenshot from our sandbox environment (app.hyperswitch.io)

@lsampras, I've addressed your review. Could you please review it? |
docker-compose.yml
Outdated
- SDK_ENV=${SDK_ENV:-local} | ||
- ENV_SDK_URL=${ENV_SDK_URL:-http://localhost:9050/HyperLoader.js} | ||
- ENV_BACKEND_URL=${ENV_BACKEND_URL:-http://localhost:8080} | ||
- ENV_LOGGING_URL=${ENV_LOGGING_URL:-http://localhost:3100} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you picked this up from the issue that was mentioned in the fix, but that change hasn't been merged to main
branch yet,
either use the older SDK variable keys or pull that branch instead of main in your dockerfile
docker/web.Dockerfile
Outdated
@@ -4,12 +4,12 @@ RUN npm install concurrently -g | |||
|
|||
WORKDIR /hyperswitch-web | |||
|
|||
RUN git clone https://github.com/juspay/hyperswitch-web . | |||
RUN git clone https://github.com/juspay/hyperswitch-web . --depth 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordering here seems incorrect
docker-compose.yml
Outdated
hyperswitch-server: | ||
condition: service_started | ||
- SDK_ENV=${SDK_ENV:-local} | ||
- ENV_SDK_URL=${ENV_SDK_URL:-http://localhost:9050/HyperLoader.js} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't have the HyperLoader.js
at the end this is supposed to be the base url only
docker-compose.yml
Outdated
- SDK_ENV=${SDK_ENV:-local} | ||
- ENV_SDK_URL=${ENV_SDK_URL:-http://localhost:9050/HyperLoader.js} | ||
- ENV_BACKEND_URL=${ENV_BACKEND_URL:-http://localhost:8080} | ||
- ENV_LOGGING_URL=${ENV_LOGGING_URL:-http://localhost:3100} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add these variables back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, will add it.
I'm getting this errors since morning on hyperswitch-router:standalone
Unable to deserialize `stripe` as `api_models::enums::PayoutConnectors`: Matching variant not found
thread 'main' panicked at crates/router/src/bin/router.rs:14:10:
Unable to construct application configuration: ConfigurationError(Some errors occurred:
Unable to deserialize `stripe` as `api_models::enums::PayoutConnectors`: Matching variant not found)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@lsampras do you have any idea regarding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this seems to be caused by recent changes to the docker_compose.toml
file.
I would have suggested checking out to the v1.107.0
tag before running the Docker Compose setup, but since you need to open a PR against the main
branch, that isn't an option. You can remove stripe
from the payout_connector_list
line in the docker_compose.toml
file to be able to run the Docker Compose setup, and you need not push the docker_compose.toml
change as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help @SanchithHegde
Also when I'm trying to preview payment from control center UI is authenticating request with beta.hyperswitch.io
is that expected?
I'm getting this errors on
@SanchithHegde do you have any idea regarding this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can get this merged for now, seems good for the most part
Thanks @SanchithHegde and @lsampras for your time and approving this PR. |
Type of Change
Description
Added web client and control center services to docker-compose.yml
REF : #4110
Additional Changes