From 8b580b787fd31c8d293f8dcdf500968127ffeed4 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 12 Apr 2019 09:04:31 +0200 Subject: [PATCH] add initial postgres database connector --- .circleci/config.yml | 6 ++++++ docker-compose.yml | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8edaa05..8ccaaa1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,12 @@ jobs: server: docker: - image: circleci/golang:1.12 + environment: + - POSTGRES_CONNECTION_STRING=postgres://circle:test@localhost:5432/circle_test?sslmode=disable + - image: circleci/postgres:11.2-alpine + environment: + - POSTGRES_USER=circle + - POSTGRES_PASSWORD=test working_directory: ~/offen/server steps: - checkout: diff --git a/docker-compose.yml b/docker-compose.yml index 04c45f3..d171cf4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,14 @@ server: - $GOPATH/pkg/mod:/go/pkg/mod environment: - GOPATH=/go + - POSTGRES_CONNECTION_STRING=postgres://postgres:develop@database:5432/postgres?sslmode=disable ports: - 8080:8080 command: go run cmd/server/main.go + links: + - database + +database: + image: postgres:11.2 + environment: + - POSTGRES_PASSWORD=develop