Skip to content

Commit

Permalink
Add Router Postgres project
Browse files Browse the repository at this point in the history
  • Loading branch information
catalinailie committed May 16, 2023
1 parent 5abfda0 commit 48c04e1
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ services:
- publishing-api.dev.gov.uk
- release.dev.gov.uk
- router-api.dev.gov.uk
- router-api-postgres.dev.gov.uk
- router.dev.gov.uk
- router-postgres.dev.gov.uk
- search-admin.dev.gov.uk
- search-api.dev.gov.uk
- search.dev.gov.uk
Expand Down
1 change: 1 addition & 0 deletions projects/router-postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM golang:1.20.2
4 changes: 4 additions & 0 deletions projects/router-postgres/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
router-postgres: clone-router-postgres
$(GOVUK_DOCKER) pull postgres-14
$(GOVUK_DOCKER) run --rm postgres-14
$(GOVUK_DOCKER) run $@-lite make build
50 changes: 50 additions & 0 deletions projects/router-postgres/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: '3.7'

x-router: &router-postgres
build:
context: .
dockerfile: projects/router-postgres/Dockerfile
image: router-postgres
volumes:
- go:/go
- ${GOVUK_ROOT_DIR:-~/govuk}/router-postgres:/go/src/github.com/alphagov/router-postgres:delegated
- root-home:/root
working_dir: /go/src/github.com/alphagov/router-postgres

services:
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"


router-postgres-app: &router-postgres-app
<<: *router-postgres
depends_on:
- postgres-14
- nginx-proxy
expose:
- "8080"
- "3055"
environment:
VIRTUAL_HOST: router.dev.gov.uk,www.dev.gov.uk,www-origin.dev.gov.uk
VIRTUAL_PORT: 8080
DATABASE_URL: "postgresql://postgres@postgres-14/router"
ROUTER_APIADDR: :3055
ROUTER_BACKEND_HEADER_TIMEOUT: 60s
command: ./router

router-postgres-app-draft:
<<: *router-postgres-app
environment:
VIRTUAL_HOST: draft-router.dev.gov.uk,draft-origin.dev.gov.uk
VIRTUAL_PORT: 8080
DATABASE_URL: "postgresql://postgres@postgres-14/router"
ROUTER_APIADDR: :3055
ROUTER_BACKEND_HEADER_TIMEOUT: 60s

0 comments on commit 48c04e1

Please sign in to comment.