Skip to content

Commit

Permalink
chore: new docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjoeoui committed Apr 29, 2024
1 parent 1893a88 commit 799999e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 46 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- "main"
- "joey/azure" # TODO: remove this

jobs:
build-web:
Expand Down
72 changes: 26 additions & 46 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,60 +97,29 @@ resource "azurerm_network_interface" "flojoy-cloud-nic" {
}
}

resource "azurerm_linux_virtual_machine" "flojoy-cloud-vm" {
name = "flojoy-cloud-vm"
resource_group_name = azurerm_resource_group.flojoy-cloud-rg.name
location = azurerm_resource_group.flojoy-cloud-rg.location
size = "Standard_DS1_v2"
admin_username = "adminuser"
network_interface_ids = [
azurerm_network_interface.flojoy-cloud-nic.id
]

os_disk {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}

source_image_reference {
publisher = "Canonical"
offer = "0001-com-ubuntu-server-jammy"
sku = "22_04-lts"
version = "latest"
}

admin_ssh_key {
username = "adminuser"
public_key = file("~/.ssh/flojoy_cloud.pub")
}
resource "azurerm_postgresql_flexible_server" "flojoy-cloud-postgres-server" {
name = "flojoy-cloud-postgres-server"
resource_group_name = azurerm_resource_group.flojoy-cloud-rg.name
location = azurerm_resource_group.flojoy-cloud-rg.location
version = 12
administrator_login = "postgresadmin"
administrator_password = "P@ssw0rd1234"
storage_mb = 32768
sku_name = "GP_Standard_D4s_v3"
zone = "1"

tags = {
environment = "production"
}
}

resource "azurerm_postgresql_server" "flojoy-cloud-postgres-server" {
name = "flojoy-cloud-postgres-server"
resource_group_name = azurerm_resource_group.flojoy-cloud-rg.name
location = azurerm_resource_group.flojoy-cloud-rg.location
sku_name = "B_Gen5_2"
storage_mb = 5120
version = 11
administrator_login = "postgresadmin"
administrator_login_password = "P@ssw0rd1234"
ssl_enforcement_enabled = true

tags = {
environment = "production"
}
}

resource "azurerm_postgresql_database" "flojoy-cloud-postgres-db" {
name = "flojoy-cloud-postgres-db"
resource_group_name = azurerm_resource_group.flojoy-cloud-rg.name
server_name = azurerm_postgresql_server.flojoy-cloud-postgres-server.name
charset = "UTF8"
collation = "English_United States.1252"
resource "azurerm_postgresql_flexible_server_database" "flojoy-cloud-postgres-db" {
name = "flojoy-cloud-postgres-db"
server_id = azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.id
charset = "utf8"
collation = "en_US.utf8"

# prevent the possibility of accidental data loss
lifecycle {
Expand Down Expand Up @@ -193,6 +162,17 @@ resource "azurerm_container_group" "flojoy-cloud-container-group" {
port = 3000
protocol = "TCP"
}

environment_variables = {
NODE_ENV = "production"
DATABASE_URL = "postgres://admin:password@${azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.fqdn}/flojoy_cloud"
WEB_URI = "http://localhost:5173"
JWT_SECRET = ""
ENTRA_TENANT_ID = ""
ENTRA_CLIENT_ID = ""
ENTRA_CLIENT_SECRET = ""
ENTRA_REDIRECT_URI = ""
}
}
}

0 comments on commit 799999e

Please sign in to comment.