Skip to content

Provision the new postgres router/router-api apps in govuk-docker #658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ 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
- search-admin.dev.gov.uk
- search-api.dev.gov.uk
Expand Down
3 changes: 3 additions & 0 deletions projects/router-api-postgres/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
router-api-postgres: bundle-router-api-postgres
$(GOVUK_DOCKER) run $@-lite bin/rake db:prepare
$(GOVUK_DOCKER) run $@-lite env RAILS_ENV=test bin/rake db:prepare
39 changes: 39 additions & 0 deletions projects/router-api-postgres/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: '3.7'

volumes:
router-api-postgres-tmp:

x-router-api-postgres: &router-api-postgres
build:
context: .
dockerfile: Dockerfile.govuk-base
image: router-api-postgres
stdin_open: true
tty: true
volumes:
- ${GOVUK_ROOT_DIR:-~/govuk}:/govuk:delegated
- root-home:/root
- router-api-postgres-tmp:/govuk/router-api-postgres/tmp
working_dir: /govuk/router-api-postgres

services:
router-api-postgres-lite: &router-api-postgres-lite
<<: *router-api-postgres
depends_on:
- postgres-14
environment:
DATABASE_URL: "postgresql://postgres@postgres-14/router"
TEST_DATABASE_URL: "postgresql://postgres@postgres-14/router"

router-api-postgres-app: &router-api-postgres-app
<<: *router-api-postgres
depends_on:
- nginx-proxy
- postgres-14
environment:
DATABASE_URL: "postgresql://postgres@postgres-14/router"
VIRTUAL_HOST: router-api-postgres.dev.gov.uk
BINDING: 0.0.0.0
expose:
- "3000"
command: bin/rails s --restart