---
name: ComposeTraefikConfig
lang: go
domain: infra
version: "1.0.0"
algebraic: product
definition: |
  type ComposeTraefikConfig struct {
      ProjectName  string
      ServiceName  string
      BuildContext string
      Dockerfile   string
      Port         int
      VolumeName   string
      EnvVars      []string
      Network      string
  }
description: "Parametriza la generacion de un docker-compose.yml para una app Go desplegada behind Traefik + Coolify. Usado por generate_compose_traefik."
tags: [docker, compose, traefik, coolify, config, infra, deploy]
uses_types: []
file_path: "functions/infra/compose_traefik_config.go"
---

## Ejemplo

```go
cfg := ComposeTraefikConfig{
    ProjectName:  "registry-api",
    ServiceName:  "registry_api",
    BuildContext: "../../",
    Dockerfile:   "apps/registry_api/Dockerfile",
    Port:         8420,
    VolumeName:   "registry_data",
    EnvVars:      []string{"REGISTRY_API_TOKEN"},
    Network:      "coolify",
}
```

## Notas

`VolumeName` vacio omite la seccion `volumes:` y el mount `/data`. `EnvVars` es una lista ordenada de nombres de variables de entorno que se pasan como passthrough con `${KEY:-}`. `Network` es la red externa de Coolify (por convencion `"coolify"`).
