From 562db5b312ffdbbf42fe3447789332fb4ed3b6da Mon Sep 17 00:00:00 2001 From: bizk Date: Wed, 13 Sep 2023 20:53:49 -0300 Subject: [PATCH] added docker compose file and dockerfile --- Dockerfile | 24 +++++++++++++++++++++ tests/{compose.yaml => docker-compose.yaml} | 9 +------- 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 Dockerfile rename tests/{compose.yaml => docker-compose.yaml} (81%) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d2950d1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.20-alpine AS build-env + +# Install minimum necessary dependencies +ENV PACKAGES curl make +RUN apk add --no-cache $PACKAGES + +# Set working directory for the build +WORKDIR /go/src/github.com/cosmos/rosetta + +# optimization: if go.sum didn't change, docker will use cached image +COPY go.mod go.sum ./ + +RUN go mod download + +# Add source files +COPY . . + +RUN make build + +EXPOSE 8080 + +# Run simd by default +CMD ["./rosetta"] +STOPSIGNAL SIGTERM \ No newline at end of file diff --git a/tests/compose.yaml b/tests/docker-compose.yaml similarity index 81% rename from tests/compose.yaml rename to tests/docker-compose.yaml index 8f5723f..e94ea8e 100644 --- a/tests/compose.yaml +++ b/tests/docker-compose.yaml @@ -40,16 +40,9 @@ services: ports: - 8080:8080 - faucet: - image: tendermintdev/rosetta-cli:v0.6.7 - working_dir: /rosetta - command: ["python3", "./config/faucet.py"] - expose: - - 8080 - test_rosetta: image: tendermintdev/rosetta-cli:v0.6.7 volumes: - - ./config:/rosetta/config:z + - ./config:/rosetta:z command: ["./config/run_tests.sh"] working_dir: /rosetta \ No newline at end of file