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 client and control center services to docker compose setup #4197

Merged
merged 17 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
47 changes: 40 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,39 @@ services:
labels:
logs: "promtail"

### Web Client
hyperswitch-web:
prasad89 marked this conversation as resolved.
Show resolved Hide resolved
ports:
- "9050:9050"
- "9060:9060"
- "5252:5252"
build:
context: ./docker
dockerfile: web.Dockerfile
networks:
- router_net
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct

environment:
- HYPERSWITCH_SERVER_URL=http://hyperswitch-server:8080
depends_on:
hyperswitch-server:
condition: service_started
lsampras marked this conversation as resolved.
Show resolved Hide resolved

### Control Center
hyperswitch-control-center:
prasad89 marked this conversation as resolved.
Show resolved Hide resolved
image: juspaydotin/hyperswitch-control-center
Copy link
Member

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?

Copy link
Contributor Author

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

ports:
- "9000:9000"
networks:
- router_net
Copy link
Member

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.

environment:
- apiBaseUrl=http://hyperswitch-server:8080
- sdkBaseUrl=http://hyperswitch-web:9050
depends_on:
hyperswitch-server:
condition: service_started
hyperswitch-web:
condition: service_started
lsampras marked this conversation as resolved.
Show resolved Hide resolved

### Clustered Redis setup
redis-cluster:
image: redis:7
Expand Down Expand Up @@ -290,19 +323,19 @@ services:
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_PROCESS_ROLES: "broker,controller"
SanchithHegde marked this conversation as resolved.
Show resolved Hide resolved
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka0:29093'
KAFKA_LISTENERS: 'PLAINTEXT://kafka0:29092,CONTROLLER://kafka0:29093,PLAINTEXT_HOST://0.0.0.0:9092'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs'
KAFKA_CONTROLLER_QUORUM_VOTERS: "1@kafka0:29093"
KAFKA_LISTENERS: "PLAINTEXT://kafka0:29092,CONTROLLER://kafka0:29093,PLAINTEXT_HOST://0.0.0.0:9092"
KAFKA_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
KAFKA_LOG_DIRS: "/tmp/kraft-combined-logs"
JMX_PORT: 9997
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka0 -Dcom.sun.management.jmxremote.rmi.port=9997
profiles:
- analytics
volumes:
- ./monitoring/kafka-script.sh:/tmp/update_run.sh
command: "bash -c 'if [ ! -f /tmp/update_run.sh ]; then echo \"ERROR: Did you forget the update_run.sh file that came with this docker-compose.yml file?\" && exit 1 ; else /tmp/update_run.sh && /etc/confluent/docker/run ; fi'"
command: 'bash -c ''if [ ! -f /tmp/update_run.sh ]; then echo "ERROR: Did you forget the update_run.sh file that came with this docker-compose.yml file?" && exit 1 ; else /tmp/update_run.sh && /etc/confluent/docker/run ; fi'''

# Kafka UI for debugging kafka queues
kafka-ui:
Expand Down Expand Up @@ -332,4 +365,4 @@ services:
ulimits:
nofile:
soft: 262144
hard: 262144
hard: 262144
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:lts-alpine

RUN npm install concurrently -g

WORKDIR /hyperswitch-web

RUN git clone https://github.com/juspay/hyperswitch-web .
lsampras marked this conversation as resolved.
Show resolved Hide resolved

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
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No


RUN npm install

EXPOSE 9050
EXPOSE 5252
EXPOSE 9060

CMD concurrently "npm run start:dev" "npm run start:playground"
Loading