docker updates

rm makefile
This commit is contained in:
Roy Crihfield 2023-08-25 20:09:40 +08:00
parent 90f64c2a94
commit 07614a8719
4 changed files with 6 additions and 20 deletions

View File

@ -9,12 +9,12 @@ ADD . /go/src/github.com/vulcanize/eth-statediff-service
#RUN git clone https://github.com/vulcanize/eth-statediff-service.git /go/src/github.com/vulcanize/eth-statediff-service #RUN git clone https://github.com/vulcanize/eth-statediff-service.git /go/src/github.com/vulcanize/eth-statediff-service
WORKDIR /go/src/github.com/vulcanize/eth-statediff-service WORKDIR /go/src/github.com/vulcanize/eth-statediff-service
RUN GO111MODULE=on GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o eth-statediff-service . RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o eth-statediff-service .
# app container # app container
FROM alpine FROM alpine
ARG USER="vdm" ARG USER="vdbm"
ARG CONFIG_FILE="./environments/docker.toml" ARG CONFIG_FILE="./environments/docker.toml"
ARG EXPOSE_PORT=8545 ARG EXPOSE_PORT=8545

View File

@ -1,12 +0,0 @@
## Build docker image
.PHONY: docker-build
docker-build:
docker build -t vulcanize/eth-statediff-service .
.PHONY: test
test: | $(GOOSE)
go test -p 1 ./pkg/... -v
build:
go fmt ./...
go build

View File

@ -1,21 +1,19 @@
version: '3.2'
services: services:
eth-statediff-service: eth-statediff-service:
build: build:
context: ./ context: ./
cache_from: cache_from:
- alpine:latest - alpine:latest
- golang:1.16 - golang:1.18
dockerfile: ./Dockerfile dockerfile: ./Dockerfile
args: args:
USER: "vdbm" USER: "vdbm"
CONFIG_FILE: ./environments/example.toml CONFIG_FILE: ./environments/docker.toml
EXPOSE_PORT: 8545 EXPOSE_PORT: 8545
environment: environment:
- VDB_COMMAND=serve - VDB_COMMAND=serve
volumes: volumes:
- eth-statediff-service-data:/root/.ethereum/ - eth-statediff-service-data:/vdbm/.ethereum/
ports: ports:
- "127.0.0.1:8545:8545" - "127.0.0.1:8545:8545"

View File

@ -17,4 +17,4 @@ mkdir -p /app/geth-rw && \
sudo mount -t overlay overlay -o lowerdir=/app/geth-ro,upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work /app/geth-rw && \ sudo mount -t overlay overlay -o lowerdir=/app/geth-ro,upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work /app/geth-rw && \
echo "Running the statediff service" && \ echo "Running the statediff service" && \
sudo ./eth-statediff-service "$VDB_COMMAND" --config=config.toml exec sudo ./eth-statediff-service "$VDB_COMMAND" --config=config.toml