From 08bb5d0eca6f6ae9728aac932a21f3e25ebc3870 Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Fri, 21 Aug 2020 23:10:38 -0500 Subject: [PATCH] fix: update docker compose to auto migrate --- docker-compose.yml | 3 +++ magefile.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 99ab4f0..90a48e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,9 @@ services: - postgres networks: - taskcafe-test + environment: + TASKCAFE_DATABASE_HOST: postgres + TASKCAFE_MIGRATE: "true" postgres: image: postgres:12.3-alpine restart: always diff --git a/magefile.go b/magefile.go index 97d58fe..338a751 100644 --- a/magefile.go +++ b/magefile.go @@ -73,7 +73,7 @@ func (Backend) GenFrontend() error { // Build the Go api service func (Backend) Build() error { fmt.Println("compiling binary dist/taskcafe") - return sh.Run("go", "build", "-o", "dist/taskcafe", "cmd/taskcafe/main.go") + return sh.Run("go", "build", "-tags", "prod", "-o", "dist/taskcafe", "cmd/taskcafe/main.go") } // Schema merges GraphQL schema files into single schema & runs gqlgen