diff --git a/docker-compose.yml b/docker-compose.yml index 903e16ba..de72b9a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/projects/router-postgres/Dockerfile b/projects/router-postgres/Dockerfile new file mode 100644 index 00000000..0a7beb6d --- /dev/null +++ b/projects/router-postgres/Dockerfile @@ -0,0 +1 @@ +FROM golang:1.20.2 diff --git a/projects/router-postgres/Makefile b/projects/router-postgres/Makefile new file mode 100644 index 00000000..b715557d --- /dev/null +++ b/projects/router-postgres/Makefile @@ -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 diff --git a/projects/router-postgres/docker-compose.yml b/projects/router-postgres/docker-compose.yml new file mode 100644 index 00000000..b932123d --- /dev/null +++ b/projects/router-postgres/docker-compose.yml @@ -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