From fa6fe360e235953bc4556924c64c5e8072ba150f Mon Sep 17 00:00:00 2001 From: JoshuaLicense Date: Wed, 1 May 2024 09:07:04 +0100 Subject: [PATCH 1/2] fix(docker): migrate containers to port 8080 --- compose.yaml | 6 +++--- infra/docker/api/Dockerfile | 2 ++ infra/docker/api/api.conf | 4 ++-- infra/docker/internal/Dockerfile | 2 ++ infra/docker/internal/internal.conf | 4 ++-- infra/docker/selfserve/Dockerfile | 2 ++ infra/docker/selfserve/selfserve.conf | 4 ++-- infra/terraform/modules/service/README.md | 2 +- infra/terraform/modules/service/ecs.tf | 3 ++- 9 files changed, 18 insertions(+), 11 deletions(-) diff --git a/compose.yaml b/compose.yaml index a4528ade22..af913a908e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -12,7 +12,7 @@ services: context: infra/docker/api target: development expose: - - 80 + - 8080 volumes: - ./app/api:/var/www/html environment: @@ -27,7 +27,7 @@ services: context: infra/docker/selfserve target: development expose: - - 80 + - 8080 volumes: - ./app/selfserve:/var/www/html environment: @@ -42,7 +42,7 @@ services: context: infra/docker/internal target: development expose: - - 80 + - 8080 volumes: - ./app/internal:/var/www/html environment: diff --git a/infra/docker/api/Dockerfile b/infra/docker/api/Dockerfile index 2a67c5e868..f1504b8a4c 100644 --- a/infra/docker/api/Dockerfile +++ b/infra/docker/api/Dockerfile @@ -24,6 +24,8 @@ COPY ./php.ini ${PHP_INI_DIR}/conf.d/zzzz-php.ini # nginx server config file COPY api.conf /etc/nginx/conf.d/api.conf +EXPOSE 8080 + FROM api AS production ADD ./api.tar.gz /var/www/html diff --git a/infra/docker/api/api.conf b/infra/docker/api/api.conf index 8056d06f7d..a5fe90656b 100644 --- a/infra/docker/api/api.conf +++ b/infra/docker/api/api.conf @@ -1,6 +1,6 @@ server { - listen 80; - listen [::]:80; + listen 8080; + listen [::]:8080; server_name _; diff --git a/infra/docker/internal/Dockerfile b/infra/docker/internal/Dockerfile index 31f8575228..428c174071 100644 --- a/infra/docker/internal/Dockerfile +++ b/infra/docker/internal/Dockerfile @@ -21,6 +21,8 @@ COPY ./php.ini ${PHP_INI_DIR}/conf.d/zzzz-php.ini # nginx server config file COPY internal.conf /etc/nginx/conf.d/internal.conf +EXPOSE 8080 + FROM internal AS production ADD ./internal.tar.gz /var/www/html diff --git a/infra/docker/internal/internal.conf b/infra/docker/internal/internal.conf index c845518d7d..9160192a61 100644 --- a/infra/docker/internal/internal.conf +++ b/infra/docker/internal/internal.conf @@ -24,8 +24,8 @@ map $sent_http_content_type $x_frame_options { } server { - listen 80; - listen [::]:80; + listen 8080; + listen [::]:8080; server_name _; diff --git a/infra/docker/selfserve/Dockerfile b/infra/docker/selfserve/Dockerfile index 6f1317f65b..9a8edf0897 100644 --- a/infra/docker/selfserve/Dockerfile +++ b/infra/docker/selfserve/Dockerfile @@ -21,6 +21,8 @@ COPY ./php.ini ${PHP_INI_DIR}/conf.d/zzzz-php.ini # nginx server config file COPY selfserve.conf /etc/nginx/conf.d/selfserve.conf +EXPOSE 8080 + FROM selfserve AS production ADD ./selfserve.tar.gz /var/www/html diff --git a/infra/docker/selfserve/selfserve.conf b/infra/docker/selfserve/selfserve.conf index c845518d7d..9160192a61 100644 --- a/infra/docker/selfserve/selfserve.conf +++ b/infra/docker/selfserve/selfserve.conf @@ -24,8 +24,8 @@ map $sent_http_content_type $x_frame_options { } server { - listen 80; - listen [::]:80; + listen 8080; + listen [::]:8080; server_name _; diff --git a/infra/terraform/modules/service/README.md b/infra/terraform/modules/service/README.md index 9a94c33eb1..b1b033dd67 100644 --- a/infra/terraform/modules/service/README.md +++ b/infra/terraform/modules/service/README.md @@ -42,7 +42,7 @@ | [assets\_version](#input\_assets\_version) | The version of the assets | `string` | n/a | yes | | [domain\_name](#input\_domain\_name) | The domain name for the environment | `string` | n/a | yes | | [environment](#input\_environment) | The environment to deploy to | `string` | n/a | yes | -| [services](#input\_services) | The services to deploy |
map(object({
image = string
cpu = number
memory = number
security_group_ids = list(string)
subnet_ids = list(string)
}))
| `{}` | no | +| [services](#input\_services) | The services to deploy |
map(object({
image = string
cpu = number
memory = number
security_group_ids = list(string)
subnet_ids = list(string)
target_group_arn = string
}))
| `{}` | no | ## Outputs diff --git a/infra/terraform/modules/service/ecs.tf b/infra/terraform/modules/service/ecs.tf index 58e9b5a776..d0f3a6c6f8 100644 --- a/infra/terraform/modules/service/ecs.tf +++ b/infra/terraform/modules/service/ecs.tf @@ -39,7 +39,8 @@ module "ecs_service" { port_mappings = [ { name = "http" - containerPort = 80 + hostPort = 8080 + containerPort = 8080 protocol = "tcp" } ] From 44c88b7c034fd78bedd394bbcb72d136e9bf570b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 1 May 2024 08:16:20 +0000 Subject: [PATCH 2/2] docs: update Terraform docs --- infra/terraform/modules/service/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/terraform/modules/service/README.md b/infra/terraform/modules/service/README.md index b1b033dd67..9a94c33eb1 100644 --- a/infra/terraform/modules/service/README.md +++ b/infra/terraform/modules/service/README.md @@ -42,7 +42,7 @@ | [assets\_version](#input\_assets\_version) | The version of the assets | `string` | n/a | yes | | [domain\_name](#input\_domain\_name) | The domain name for the environment | `string` | n/a | yes | | [environment](#input\_environment) | The environment to deploy to | `string` | n/a | yes | -| [services](#input\_services) | The services to deploy |
map(object({
image = string
cpu = number
memory = number
security_group_ids = list(string)
subnet_ids = list(string)
target_group_arn = string
}))
| `{}` | no | +| [services](#input\_services) | The services to deploy |
map(object({
image = string
cpu = number
memory = number
security_group_ids = list(string)
subnet_ids = list(string)
}))
| `{}` | no | ## Outputs