Skip to content

Commit 13942e7

Browse files
committed
Update Router-Postgres project files to match new build structure
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.
1 parent 6b061dd commit 13942e7

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

projects/router-postgres/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
router-postgres: clone-router-postgres
2-
$(GOVUK_DOCKER) pull postgres-14
3-
$(GOVUK_DOCKER) run --rm -d postgres-14
2+
$(GOVUK_DOCKER) up -d postgres-14
43
$(GOVUK_DOCKER) run $@-lite make build
4+

projects/router-postgres/docker-compose.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ x-router: &router-postgres
1212
working_dir: /go/src/github.com/alphagov/router-postgres
1313

1414
services:
15-
router-postgres-lite:
15+
router-postgres-lite: &router-postgres-lite
1616
<<: *router-postgres
1717
depends_on:
1818
- postgres-14
1919
environment:
2020
GOFLAGS: -buildvcs=false
2121
BINARY: /go/src/github.com/alphagov/router-postgres/router-postgres
2222
DEBUG: "true"
23-
DATABASE_URL: "postgresql://postgres@postgres-14/router"
24-
TEST_DATABASE_URL: "postgresql://postgres@postgres-14/router"
25-
23+
DATABASE_URL: "postgresql://postgres@postgres-14/router?sslmode=disable"
24+
TEST_DATABASE_URL: "postgresql://postgres@postgres-14/router-test?sslmode=disable"
2625

2726
router-postgres-app: &router-postgres-app
2827
<<: *router-postgres
@@ -33,14 +32,14 @@ services:
3332
- "8080"
3433
- "3055"
3534
environment:
36-
VIRTUAL_HOST: router.dev.gov.uk,www.dev.gov.uk,www-origin.dev.gov.uk
35+
VIRTUAL_HOST: router-postgres.dev.gov.uk,www.dev.gov.uk,www-origin.dev.gov.uk
3736
VIRTUAL_PORT: 8080
38-
DATABASE_URL: "postgresql://postgres@postgres-14/router"
37+
DATABASE_URL: "postgresql://postgres@postgres-14/router?sslmode=disable"
3938
ROUTER_APIADDR: :3055
4039
ROUTER_BACKEND_HEADER_TIMEOUT: 60s
4140
command: ./router-postgres
4241

43-
router-postgres-app-draft:
42+
router-postgres-app-draft: &router-postgres-app-draft
4443
<<: *router-postgres-app
4544
environment:
4645
VIRTUAL_HOST: draft-router.dev.gov.uk,draft-origin.dev.gov.uk

0 commit comments

Comments
 (0)