Skip to content

Commit

Permalink
Update Router-Postgres project files to match new build structure
Browse files Browse the repository at this point in the history
Have to directly access the Database with sslmode disabled. Unlike
with Mongo, we cannot rely on replica sets so must create the database
dynamically on launch (if a database does not exist). This is done in
the makefile of Router-Postgres on that tool's branch.
  • Loading branch information
Tetrino authored and catalinailie committed Jun 29, 2023
1 parent 9d19bdc commit da4cedb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions projects/router-postgres/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
router-postgres: clone-router-postgres
$(GOVUK_DOCKER) pull postgres-14
$(GOVUK_DOCKER) run --rm -d postgres-14
$(GOVUK_DOCKER) up -d postgres-14
$(GOVUK_DOCKER) run $@-lite make build

13 changes: 6 additions & 7 deletions projects/router-postgres/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ x-router: &router-postgres
working_dir: /go/src/github.com/alphagov/router-postgres

services:
router-postgres-lite:
router-postgres-lite: &router-postgres-lite
<<: *router-postgres
depends_on:
- postgres-14
environment:
GOFLAGS: -buildvcs=false
BINARY: /go/src/github.com/alphagov/router-postgres/router-postgres
DEBUG: "true"
DATABASE_URL: "postgresql://postgres@postgres-14/router"
TEST_DATABASE_URL: "postgresql://postgres@postgres-14/router"

DATABASE_URL: "postgresql://postgres@postgres-14/router?sslmode=disable"
TEST_DATABASE_URL: "postgresql://postgres@postgres-14/router-test?sslmode=disable"

router-postgres-app: &router-postgres-app
<<: *router-postgres
Expand All @@ -33,14 +32,14 @@ services:
- "8080"
- "3055"
environment:
VIRTUAL_HOST: router.dev.gov.uk,www.dev.gov.uk,www-origin.dev.gov.uk
VIRTUAL_HOST: router-postgres.dev.gov.uk,www.dev.gov.uk,www-origin.dev.gov.uk
VIRTUAL_PORT: 8080
DATABASE_URL: "postgresql://postgres@postgres-14/router"
DATABASE_URL: "postgresql://postgres@postgres-14/router?sslmode=disable"
ROUTER_APIADDR: :3055
ROUTER_BACKEND_HEADER_TIMEOUT: 60s
command: ./router-postgres

router-postgres-app-draft:
router-postgres-app-draft: &router-postgres-app-draft
<<: *router-postgres-app
environment:
VIRTUAL_HOST: draft-router.dev.gov.uk,draft-origin.dev.gov.uk
Expand Down

0 comments on commit da4cedb

Please sign in to comment.