Skip to content

Commit df9071c

Browse files
committed
fix: resolve package-lock conflicts
2 parents 82e6dea + e0dc5f7 commit df9071c

File tree

8 files changed

+32712
-156
lines changed

8 files changed

+32712
-156
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ Thumbs.db
5555

5656
#ENV VARIABLES
5757
.env
58+
59+
# Terraform files
60+
**/.terraform**

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ RUN chown -R ${USERNAME}:${USERNAME} /var/cache/nginx && \
3737
chown -R ${USERNAME}:${USERNAME} /etc/nginx/conf.d
3838
RUN touch /var/run/nginx.pid && chown -R ${USERNAME}:${USERNAME} /var/run/nginx.pid
3939

40-
USER ${USERNAME}
41-
42-
EXPOSE 4200
40+
# FIXME: Actually if we can deploy to azure in port 80 we need a root user
41+
# Maybe we can refactor this dockerfile to use root user directly this is not a good approach y
42+
# security terms. It's a good practice to have rootless in containers so for this
43+
# we can to refactor this dockerfile and the terraform module to deploy in other ports because
44+
# Ports below 1024 needs root permisions.
45+
46+
# USER ${USERNAME}
47+
48+
EXPOSE 80

infrastructure/main.tf

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
terraform {
2+
required_version = "~> 1.1.2"
3+
required_providers {
4+
azurerm = {
5+
source = "hashicorp/azurerm"
6+
version = "~> 2.90"
7+
}
8+
}
9+
10+
backend "azurerm" {
11+
resource_group_name = "ioet-infra-tf-state"
12+
storage_account_name = "timetrackertfstate"
13+
container_name = "time-tracker-tf-state"
14+
key = "time-tracker-ui.tfstate"
15+
}
16+
17+
}
18+
19+
provider "azurerm" {
20+
features {}
21+
skip_provider_registration = true
22+
}
23+
24+
data "terraform_remote_state" "service" {
25+
backend = "azurerm"
26+
workspace = terraform.workspace
27+
config = {
28+
resource_group_name = "ioet-infra-tf-state"
29+
storage_account_name = "timetrackertfstate"
30+
container_name = "time-tracker-tf-state"
31+
key = "this.tfstate"
32+
}
33+
}
34+
35+
locals {
36+
common_name = "time-tracker-ui"
37+
environment = terraform.workspace
38+
service_name = "${local.common_name}-${local.environment}"
39+
create_app_service_plan = true
40+
service_plan_kind = "Linux"
41+
image_name = "timetracker_ui"
42+
}
43+
44+
module "ui" {
45+
source = "[email protected]:ioet/infra-terraform-modules.git//azure-app-service?ref=tags/v0.0.5"
46+
app_service_name = local.service_name
47+
create_app_service_plan = local.create_app_service_plan
48+
docker_image_name = "${local.image_name}:${var.image_tag}"
49+
docker_image_namespace = data.terraform_remote_state.service.outputs.container_registry_login_server
50+
docker_registry_password = data.terraform_remote_state.service.outputs.container_registry_admin_password
51+
docker_registry_url = data.terraform_remote_state.service.outputs.container_registry_login_server
52+
docker_registry_username = data.terraform_remote_state.service.outputs.container_registry_admin_username
53+
location = data.terraform_remote_state.service.outputs.container_registry_location
54+
resource_group_name = data.terraform_remote_state.service.outputs.resource_group_name
55+
service_plan_kind = local.service_plan_kind
56+
service_plan_name = local.service_name
57+
service_plan_size = var.service_plan_size
58+
service_plan_tier = var.service_plan_tier
59+
}

infrastructure/prod.tfvars

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
service_plan_size = "S1"
2+
service_plan_tier = "Standard"

infrastructure/stage.tfvars

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
service_plan_size = "S1"
2+
service_plan_tier = "Standard"

infrastructure/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
variable "image_tag" {
2+
type = string
3+
description = "Specifies the docker image tag that is stored in a private container registry like ACR (Azure Container Registry)."
4+
sensitive = true
5+
}
6+
7+
variable "service_plan_size" {
8+
default = "S1"
9+
type = string
10+
description = "Specifies the size of the service plan. This variable format is: Tier (letter) + Size (number). Size could be: 1 = Small (1 Core 1.75GB RAM), 2 = Medium (2 Core 3.5 GB RAM), 3 = Large (4 Core 7GB RAM)"
11+
}
12+
13+
variable "service_plan_tier" {
14+
default = "Standard"
15+
type = string
16+
description = "Specifies the tier of the service plan. Tier is the pricing plan of the service plan resource."
17+
}

nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
server {
2-
listen 4200;
2+
listen 80;
33

44
root /usr/share/nginx/html;
55
index index.html;
@@ -9,4 +9,4 @@ server {
99
location / {
1010
try_files $uri /index.html;
1111
}
12-
}
12+
}

0 commit comments

Comments
 (0)