diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index f4d80c6..0000000 --- a/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# To build: -# make docker-build -# To push: -# make docker-push - -FROM golang:1.22.4-bullseye as build -ARG GIT_COMMIT - -WORKDIR /src/wallet-backend -ADD go.mod go.sum ./ -RUN go mod download -ADD . ./ -RUN go build -o /bin/wallet-backend -ldflags "-X main.GitCommit=$GIT_COMMIT" . - - -FROM ubuntu:22.04 - -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates -COPY --from=build /bin/wallet-backend /app/ -EXPOSE 8001 -WORKDIR /app -ENTRYPOINT ["./wallet-backend"] diff --git a/Makefile b/Makefile deleted file mode 100644 index 70d4c89..0000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Check if we need to prepend docker command with sudo -SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo") - -LABEL ?= $(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n)) -# If TAG is not provided set default value -TAG ?= stellar/wallet-backend:$(LABEL) -# https://github.com/opencontainers/image-spec/blob/master/annotations.md -BUILD_DATE := $(shell date -u +%FT%TZ) - -docker-build: - $(SUDO) docker build -f Dockerfile --pull --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) --build-arg GIT_COMMIT=$(LABEL) . - -docker-push: - $(SUDO) docker push $(TAG) - -go-install: - go install -ldflags "-X main.GitCommit=$(LABEL)" . \ No newline at end of file diff --git a/cmd/serve.go b/cmd/serve.go index 29ff3aa..de14e58 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -22,7 +22,7 @@ func (c *serveCmd) Command() *cobra.Command { Usage: "Port to listen and serve on", OptType: types.Int, ConfigKey: &cfg.Port, - FlagDefault: 8001, + FlagDefault: 8000, Required: false, }, { @@ -38,7 +38,7 @@ func (c *serveCmd) Command() *cobra.Command { Usage: "The server base URL", OptType: types.String, ConfigKey: &cfg.ServerBaseURL, - FlagDefault: "http://localhost:8001", + FlagDefault: "http://localhost:8000", Required: true, }, { diff --git a/docker-compose.yaml b/docker-compose.yaml index a143fff..95cb25d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,4 @@ +version: '3.8' services: db: image: postgres:12-alpine @@ -8,27 +9,6 @@ services: - postgres-db:/var/lib/postgresql/data ports: - 5432:5432 - api: - image: stellar/wallet-backend:development - build: ./ - depends_on: - db: - condition: service_started - ports: - - 8001:8001 - entrypoint: "" - command: - - sh - - -c - - | - ./wallet-backend migrate up - ./wallet-backend serve - environment: - DATABASE_URL: postgres://postgres@db:5432/wallet-backend?sslmode=disable - PORT: 8001 - SERVER_BASE_URL: http://localhost:8001 - LOG_LEVEL: TRACE - WALLET_SIGNING_KEY: GAXBXPBZNJG6PQBE7M3VTEZ4EIRVDL4TSTQEVHEOYOLMYQZWJ4WUA4YF volumes: postgres-db: diff --git a/main.go b/main.go index 9f074fb..646ab75 100644 --- a/main.go +++ b/main.go @@ -1,12 +1,6 @@ package main -import ( - "github.com/stellar/wallet-backend/cmd" -) - -// GitCommit is populated at build time by -// go build -ldflags "-X main.GitCommit=$GIT_COMMIT" -var GitCommit string +import "github.com/stellar/wallet-backend/cmd" func main() { cmd.Execute()