Last active
February 2, 2024 09:43
-
-
Save guo/f72b5ebce9a2b5ddbeb515d0e9e60ed4 to your computer and use it in GitHub Desktop.
iotex babel rpc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
iotex: | |
container_name: iotex | |
image: iotex/iotex-core:v1.12.1 | |
restart: unless-stopped | |
ports: | |
- 8080:8080 | |
- 4689:4689 | |
- 14014:14014 | |
- 15014:15014 | |
volumes: | |
- $IOTEX_HOME/data:/var/data:rw | |
- $IOTEX_HOME/log:/var/log:rw | |
- $IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro | |
- $IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro | |
command: iotex-server -config-path=/etc/iotex/config_override.yaml -genesis-path=/etc/iotex/genesis.yaml -plugin=gateway | |
nginx: | |
container_name: nginx | |
image: nginx:latest | |
ports: | |
- "80:80" # Maps host port 80 to container port 80 | |
links: | |
- iotex:iotex | |
depends_on: | |
- iotex | |
volumes: | |
- $IOTEX_HOME/etc/nginx.conf:/etc/nginx/conf.d/default.conf:ro # Mount your custom Nginx configuration | |
restart: unless-stopped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream iotex-node { | |
server iotex:15014; | |
} | |
server { | |
listen 80; | |
location / { | |
proxy_pass http://iotex-node; | |
if ($request_method = 'OPTIONS') { | |
add_header Allow-Methods OPTIONS,GET,POST,PUT,DELETE,HEAD,PATCH; | |
add_header Access-Control-Allow-Origin *; | |
add_header Access-Control-Allow-Headers *; | |
add_header Access-Control-Allow-Credentials true; | |
add_header Content-Type text/plain; | |
return 200; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment