mirror of https://github.com/poanetwork/gecko.git
Running Nginx with the ava client in the same docker container
This commit is contained in:
parent
578cc77195
commit
cc9c155391
|
@ -0,0 +1,5 @@
|
||||||
|
.env*
|
||||||
|
docker-compose.yml
|
||||||
|
Dockerfile
|
||||||
|
README.md
|
||||||
|
LICENSE
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Path to ava node
|
||||||
|
RPC_URL=http://localhost:9650/ext/bc/C/rpc
|
||||||
|
|
||||||
|
# Local path for url-request
|
||||||
|
LOCAL_URL=/rpc
|
||||||
|
|
||||||
|
# Local port for url-request
|
||||||
|
NGINX_PORT=4444
|
||||||
|
|
||||||
|
# Options for binary ava file
|
||||||
|
AVA_CMD_OPTIONS=--db-dir /db
|
|
@ -12,6 +12,7 @@ awscpu
|
||||||
*.dylib
|
*.dylib
|
||||||
*.profile
|
*.profile
|
||||||
|
|
||||||
|
.env
|
||||||
# Test binary, build with `go test -c`
|
# Test binary, build with `go test -c`
|
||||||
*.test
|
*.test
|
||||||
|
|
||||||
|
|
17
Dockerfile
17
Dockerfile
|
@ -1,11 +1,16 @@
|
||||||
# syntax=docker/dockerfile:experimental
|
# syntax=docker/dockerfile:experimental
|
||||||
|
|
||||||
FROM golang:1.13.4-buster
|
FROM golang:1.13.4-buster AS builder
|
||||||
|
|
||||||
RUN mkdir -p /go/src/github.com/ava-labs
|
WORKDIR /src/github.com/ava-labs/
|
||||||
|
|
||||||
WORKDIR $GOPATH/src/github.com/ava-labs/
|
|
||||||
COPY . gecko
|
COPY . gecko
|
||||||
|
WORKDIR /src/github.com/ava-labs/gecko
|
||||||
WORKDIR $GOPATH/src/github.com/ava-labs/gecko
|
|
||||||
RUN ./scripts/build.sh
|
RUN ./scripts/build.sh
|
||||||
|
|
||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
COPY --from=builder /src/github.com/ava-labs/gecko/build /build
|
||||||
|
COPY entrypoint.sh nginx.template ./
|
||||||
|
|
||||||
|
CMD ["/bin/bash", "entrypoint.sh"]
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
ava_node:
|
||||||
|
build: .
|
||||||
|
image: poanetwork/ava-node
|
||||||
|
volumes:
|
||||||
|
- ~/.gecko/db:/db
|
||||||
|
- ./nginx.template:/etc/nginx/conf.d/nginx.template
|
||||||
|
ports:
|
||||||
|
- ${NGINX_PORT}:${NGINX_PORT}
|
||||||
|
env_file: .env
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "RECREATE NGINX CONFIG"
|
||||||
|
envsubst < /etc/nginx/conf.d/nginx.template > /etc/nginx/conf.d/default.conf
|
||||||
|
echo "START NGINX"
|
||||||
|
service nginx start
|
||||||
|
echo "START NODE WITH ARGS ${AVA_CMD_OPTIONS}"
|
||||||
|
./build/ava ${AVA_CMD_OPTIONS}
|
|
@ -0,0 +1,6 @@
|
||||||
|
server {
|
||||||
|
listen ${NGINX_PORT};
|
||||||
|
location ${LOCAL_URL} {
|
||||||
|
proxy_pass ${RPC_URL};
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue