Skip to main content

Environment deltas

Config

package main

import (
"stakpak.dev/devx/v1"
"stakpak.dev/devx/v1/traits"
)

stack: v1.#Stack & {
components: {
cowsay: {
traits.#Workload
containers: default: {
image: "docker/whalesay"
command: ["cowsay"]
}
}
}
}

builders: {
env1: components: cowsay: containers: default: args: ["Hello DEV!"]
env2: components: cowsay: containers: default: args: ["Hello PROD!"]
}

Build

devx build env1
devx build env2

Result

docker-compose-env1.yml
version: "3"
volumes: {}
services:
cowsay:
image: docker/whalesay
environment: {}
depends_on: []
command:
- cowsay
- Hello DEV!
restart: always
volumes: []