Skip to content

Commit 59540a7

Browse files
VIA-345 AJ Update docker file and readme for dynamic url
1 parent 37c6212 commit 59540a7

File tree

4 files changed

+9
-28
lines changed

4 files changed

+9
-28
lines changed

infrastructure/environments/test/fake-api/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ COPY --chmod=0755 <<EOF /entrypoint.sh
99
#!/bin/sh
1010
set -e
1111

12-
export LOGIN_ROOT_URL=\${LOGIN_ROOT_URL:-'http://api.test.vita.internal'}
13-
export APP_ROOT_URL=\${APP_ROOT_URL:-'http://app.test.vita.internal'}
12+
export LOGIN_ROOT_URL=\${LOGIN_ROOT_URL:-'http://localhost:9123'}
13+
export APP_ROOT_URL=\${APP_ROOT_URL:-'https://localhost:3000'}
1414
export ELID_DELAY_SECONDS=\${ELID_DELAY_SECONDS:-0}
1515
export APIM_DELAY_SECONDS=\${APIM_DELAY_SECONDS:-0}
1616

infrastructure/environments/test/fake-api/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module "fake_api_service" {
5050
ecs_cluster_id = module.ecs_cluster.cluster_id
5151
ecs_cluster_name = module.ecs_cluster.cluster_name
5252
alb_arn = module.alb.arn
53-
alb_dns_name = module.alb.dns_name
53+
alb_dns_name = "http://${module.alb.dns_name}"
5454
app_root_url = var.app_root_url
5555
alb_security_group_id = module.alb.security_group_id
5656

infrastructure/environments/test/fake-api/readme.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ docker build --no-cache -t fake-api .
1919

2020
docker stop local-fake-api
2121

22-
docker run -d --rm -p 9123:9123 -e LOGIN_ROOT_URL="http://localhost:9123" -e APP_ROOT_URL="https://localhost:3000" -e ELID_DELAY_SECONDS=1 -e APIM_DELAY_SECONDS=1 --name local-fake-api fake-api
22+
docker run -d --rm -p 9123:9123 -e ELID_DELAY_SECONDS=1 -e APIM_DELAY_SECONDS=1 --name local-fake-api fake-api
2323

2424
docker logs local-fake-api --follow | less +F # If you need to see what's going on in nginx
2525

@@ -44,15 +44,18 @@ ELIGIBILITY_API_ENDPOINT=http://localhost:9123/
4444
IS_APIM_AUTH_ENABLED=true
4545
APIM_AUTH_URL=http://localhost:9123/oauth2/token
4646
NHS_LOGIN_URL=http://localhost:9123
47-
NHS_APP_REDIRECT_LOGIN_URL=http://localhost:3000/api/sso?assertedLoginIdentity=sausages
47+
NHS_APP_REDIRECT_LOGIN_URL=https://localhost:3000/api/sso?assertedLoginIdentity=sausages
4848
```
4949

5050
Start up VitA as normal, then hit [/api/sso](https://localhost:3000/api/sso?assertedLoginIdentity=sausages).
5151

5252
#### Build image for deployment
5353

54+
For the following steps, you need to have deployed the infrastructure at least once, to get the ALB DNS name.
55+
5456
```sh
55-
./create_tokens.sh "../../../../../vita-app-sandpit.pid" "http://api.test.vita.internal" 315569520
57+
fake_api_url="http://"$(aws elbv2 describe-load-balancers --profile vita-test | jq -r '.LoadBalancers[] | select(.LoadBalancerName == "fake-api-project-alb") | .DNSName')
58+
./create_tokens.sh "../../../../../vita-app-sandpit.pid" "$fake_api_url" 315569520
5659

5760
docker build --no-cache --platform linux/amd64 -t fake-api .
5861
```

infrastructure/environments/test/fake-api/route53.tf

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)