Skip to content

Instantly share code, notes, and snippets.

@guo
Last active February 2, 2024 09:43
Show Gist options
  • Save guo/f72b5ebce9a2b5ddbeb515d0e9e60ed4 to your computer and use it in GitHub Desktop.
Save guo/f72b5ebce9a2b5ddbeb515d0e9e60ed4 to your computer and use it in GitHub Desktop.
iotex babel rpc
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
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