MetaTrader5-Docker-Image/main.tf
Bast 4c8129829f
Some checks failed
MT5 Helm GitOps Deploy / build-and-deploy (push) Failing after 9s
fix main.tf
2026-11-03 14:21:13 -06:00

105 lines
2 KiB
HCL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.26"
}
helm = {
source = "hashicorp/helm"
version = "~> 2.12"
}
}
# Eigener State-Pfad, damit sich MT5 und die Webseite nicht in die Quere kommen
backend "consul" {
address = "consul:8500"
path = "terraform/states/mt5_tf"
}
}
# --- Variablen ---------------------------------------------------------------
variable "app_version" {
type = string
default = "latest"
}
variable "image_repository" {
type = string
default = "gmag11/metatrader5_vnc"
}
variable "vnc_user" {
type = string
default = "trader"
}
# Kommt aus TF_VAR_vnc_password (Secret MT5_VNC_PASSWORD)
variable "vnc_password" {
type = string
sensitive = true
}
variable "ingress_host" {
type = string
default = ""
}
# --- Provider ----------------------------------------------------------------
provider "kubernetes" {
config_path = "./kind_kubeconfig"
host = "https://local-k3s-platform:6443"
insecure = true
}
provider "helm" {
kubernetes {
config_path = "./kind_kubeconfig"
host = "https://local-k3s-platform:6443"
insecure = true
}
}
# --- MetaTrader 5 Deployment -------------------------------------------------
resource "helm_release" "mt5" {
name = "mt5"
chart = "./charts/mt5"
namespace = "trading"
create_namespace = true
# Erster Start installiert Wine + MT5 nach /config – das dauert ein paar Minuten
timeout = 900
wait = true
set {
name = "image.repository"
value = var.image_repository
}
set {
name = "image.tag"
value = var.app_version
}
set {
name = "auth.user"
value = var.vnc_user
}
set_sensitive {
name = "auth.password"
value = var.vnc_password
}
set {
name = "ingress.enabled"
value = var.ingress_host != "" ? "true" : "false"
}
set {
name = "ingress.host"
value = var.ingress_host
}
}