From 0bc42e301dbda0298c4c4322399fec7359e6e399 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Sat, 3 Aug 2024 15:09:27 -0500 Subject: [PATCH] rm config files from image, entrypoint noise options are all passed in env --- .dockerignore | 1 + Dockerfile | 4 ---- entrypoint.sh | 11 +---------- environments/testing.toml | 2 +- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/.dockerignore b/.dockerignore index ed36ad3f..c4aee257 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,6 +12,7 @@ integration test scripts Dockerfile +environments **/node_modules build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7ce3ca05..e9804da1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,6 @@ RUN GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' - FROM alpine ARG USER="vdm" -ARG CONFIG_FILE="./environments/example.toml" RUN adduser -Du 5000 $USER WORKDIR /app @@ -38,13 +37,10 @@ USER $USER # chown first so dir is writable # note: using $USER is merged, but not in the stable release yet -COPY --chown=5000:5000 --from=builder /go/src/github.com/cerc-io/ipld-eth-server/$CONFIG_FILE config.toml COPY --chown=5000:5000 --from=builder /go/src/github.com/cerc-io/ipld-eth-server/entrypoint.sh . - # keep binaries immutable COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-server/ipld-eth-server ipld-eth-server -COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-server/environments environments # Allow for debugging COPY --from=debugger /go/bin/dlv /usr/local/bin/ diff --git a/entrypoint.sh b/entrypoint.sh index 109736c4..0d09070a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,17 +1,8 @@ #!/bin/sh -echo "Beginning the ipld-eth-server process" - START_CMD="./ipld-eth-server" if [ "true" == "$CERC_REMOTE_DEBUG" ] && [ -x "/usr/local/bin/dlv" ]; then START_CMD="/usr/local/bin/dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec `pwd`/ipld-eth-server --continue --" fi -echo running: $START_CMD ${VDB_COMMAND} --config=`pwd`/config.toml -$START_CMD ${VDB_COMMAND} --config=`pwd`/config.toml -rv=$? - -if [ $rv != 0 ]; then - echo "ipld-eth-server startup failed" - exit 1 -fi \ No newline at end of file +exec $START_CMD ${VDB_COMMAND:-serve} diff --git a/environments/testing.toml b/environments/testing.toml index 6552cedb..a04c594b 100644 --- a/environments/testing.toml +++ b/environments/testing.toml @@ -1,5 +1,5 @@ [database] - name = "vulcanize_testing" + name = "cerc_testing" hostname = "localhost" port = 5432