Skip to content

Commit

Permalink
fix: 💚 fix config path and permission of docker-compose.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
xxamxx committed Sep 26, 2024
1 parent 2e97d42 commit abe4d57
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o /bin/web3
RUN upx -9 /bin/web3rpcproxy

FROM gcr.io/distroless/static:nonroot
WORKDIR /app/
WORKDIR /app
COPY --from=builder /bin/web3rpcproxy /bin/web3rpcproxy
COPY --from=builder --chown=nonroot /app/config /app/config

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Or

```bash
# Start the service using docker compose
$ docker-compose up -d web3-rpc-proxy
$ docker-compose up
```

Modify system configuration using the following environment variables:
Expand Down
56 changes: 30 additions & 26 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
version: "3.8"
name: web3app

configs:
proxy_config:
content: |
providers:
web3-rpc-provider:
url: "http://web3-rpc-provider:3000/endpoints"
url: "http://provider:3000/endpoints"
sources:
- ChainList
logger:
level: info
services:
postgres:
image: postgres:alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "123456"
POSTGRES_DB: web3_rpc_proxy_db
networks: [app-bridge]
ports: [5432:5432]
# Enable when you need tenant isolation and rate limiting
# postgres:
# image: postgres:16.4-alpine
# environment:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: "123456"
# POSTGRES_DB: web3_rpc_proxy_db
# networks: [app-bridge]
# ports: [5432:5432]

redis:
image: redis:alpine
ports: [6379:6379]
networks: [app-bridge]
# Enable when you need tenant isolation and rate limiting
# redis:
# image: redis:7.4.0-alpine
# ports: [6379:6379]
# networks: [app-bridge]

# provides the free web3 rpc
web3-rpc-provider:
image: web3-rpc-provider:v1.0.0
# Provides the free web3 rpc
provider:
image: dodozoo/we3-rpc-provider:v1.0.0
networks: [app-bridge]
ports: [3000:3000]

web3-rpc-proxy:
proxy:
build:
context: .
dockerfile: Dockerfile
configs:
- source: proxy_config
target: /app/default.yaml
mode: 0440
target: /app/config/default.yaml
mode: 0666
depends_on:
- web3-rpc-provider
- postgres
- redis
- provider
# - postgres
# - redis
links:
- web3-rpc-provider
- postgres
- redis
- provider
# - postgres
# - redis
networks: [app-bridge]
ports: [8080:8080]

Expand Down

0 comments on commit abe4d57

Please sign in to comment.