Skip to content

Commit

Permalink
breaking: Change default port to 8080 (#19)
Browse files Browse the repository at this point in the history
* changed default port to 8080

* changed default port to 8080

* pre-commit fixs
  • Loading branch information
diegolagospagopa authored Jan 3, 2025
1 parent 7af13fc commit 047bcd0
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 15 deletions.
17 changes: 17 additions & 0 deletions .identity/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .identity/01_github_runner.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ locals {
"AKS_NAME" : var.aks_name,
"AKS_RESOURCE_GROUP" : var.aks_resource_group,
"AZURE_AD_APPNAME" : local.app_name,
"DOMAIN": var.domain,
"DOMAIN" : var.domain,
}
}

Expand All @@ -50,7 +50,7 @@ resource "github_actions_environment_secret" "github_environment_runner_secrets"
secret_name = each.key
plaintext_value = each.value

depends_on = [ github_repository_environment.github_repository_environment_runner ]
depends_on = [github_repository_environment.github_repository_environment_runner]
}

resource "github_actions_environment_variable" "github_environment_runner_variables" {
Expand All @@ -60,6 +60,6 @@ resource "github_actions_environment_variable" "github_environment_runner_variab
variable_name = each.key
value = each.value

depends_on = [ github_repository_environment.github_repository_environment_runner ]
depends_on = [github_repository_environment.github_repository_environment_runner]

}
5 changes: 3 additions & 2 deletions .identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

| Name | Source | Version |
|------|--------|---------|
| <a name="module_github_runner_aks"></a> [github\_runner\_aks](#module\_github\_runner\_aks) | ./modules/app-github-runner-aks | n/a |
| <a name="module_github_runner_aks"></a> [github\_runner\_aks](#module\_github\_runner\_aks) | git::https://github.com/pagopa/github-actions-tf-modules.git//app-github-runner-creator | main |

## Resources

Expand All @@ -36,9 +36,10 @@
| <a name="input_aks_resource_group"></a> [aks\_resource\_group](#input\_aks\_resource\_group) | Aks cluster resource group name | `string` | n/a | yes |
| <a name="input_container_app_github_runner_env_name"></a> [container\_app\_github\_runner\_env\_name](#input\_container\_app\_github\_runner\_env\_name) | Container app env name dedicated for github runners | `string` | n/a | yes |
| <a name="input_container_app_github_runner_env_rg"></a> [container\_app\_github\_runner\_env\_rg](#input\_container\_app\_github\_runner\_env\_rg) | Container app resource group env dedicated for github runners | `string` | n/a | yes |
| <a name="input_domain"></a> [domain](#input\_domain) | Domain name | `string` | n/a | yes |
| <a name="input_env"></a> [env](#input\_env) | Environment | `string` | n/a | yes |
| <a name="input_env_short"></a> [env\_short](#input\_env\_short) | n/a | `string` | n/a | yes |
| <a name="input_github"></a> [github](#input\_github) | GitHub Organization and repository name | <pre>object({<br> org = string<br> repository = string<br> })</pre> | n/a | yes |
| <a name="input_github"></a> [github](#input\_github) | GitHub Organization and repository name | <pre>object({<br/> org = string<br/> repository = string<br/> })</pre> | n/a | yes |
| <a name="input_github_token"></a> [github\_token](#input\_github\_token) | GitHub Organization and repository name | `string` | n/a | yes |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | n/a | `string` | n/a | yes |

Expand Down
4 changes: 2 additions & 2 deletions .identity/env/devopslab_dev/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ github_repository_environment_cd = {
container_app_github_runner_env_name = "dvopla-d-neu-core-github-runner-cae"
container_app_github_runner_env_rg = "dvopla-d-neu-core-github-runner-rg"

aks_name= "dvopla-d-neu-dev01-aks"
aks_resource_group= "dvopla-d-neu-dev01-aks-rg"
aks_name = "dvopla-d-neu-dev01-aks"
aks_resource_group = "dvopla-d-neu-dev01-aks-rg"
4 changes: 2 additions & 2 deletions .identity/env/pagopa_afm_dev/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ github_repository_environment_cd = {
container_app_github_runner_env_name = "pagopa-d-weu-github-runner-cae"
container_app_github_runner_env_rg = "pagopa-d-weu-github-runner-rg"

aks_name= "pagopa-d-neu-dev-aks"
aks_resource_group= "pagopa-d-neu-dev-aks-rg"
aks_name = "pagopa-d-neu-dev-aks"
aks_resource_group = "pagopa-d-neu-dev-aks-rg"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ RUN chown -R appuser:appgroup /app
USER appuser

# Container configuration
EXPOSE 8000
EXPOSE 8080
ENV TZ=Europe/Rome \
APP_USER=appuser

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8000/health || exit 1
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1

# Run application
CMD echo "🚀 Starting status-service..." && \
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
container_name: status
restart: always
ports:
- "8000:8000"
- "8080:8080"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/"]
interval: 30s
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
)

func main() {
const web_port = ":8080"
r := mux.NewRouter()

r.HandleFunc("/", handlers.HomeHandler)
r.HandleFunc("/status", handlers.StatusHandler)
r.HandleFunc("/health", handlers.HealthHandler)
r.HandleFunc("/healthz", handlers.HealthzHandler)

log.Printf("Server starting on port 8000")
log.Fatal(http.ListenAndServe(":8000", r))
log.Printf("Server starting on port %s", web_port)
log.Fatal(http.ListenAndServe(web_port, r))
}
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
echo "Building Go application..."
go build -o status-service

echo "Starting server on port 8000..."
echo "Starting server on port 8080..."
./status-service

0 comments on commit 047bcd0

Please sign in to comment.