hrk1l2x

1 minute read

Separate environment variables

you can separates the environment variable depends on environtment (dev, stg, prod..).

you can define environment variables on docker-compose.yml or task-definition.json (AWS ECS).

ex.) terraform

  {
    "name": "",
    "hostname": "",
    "image": "",
    "network_mode": "bridge",
    "dnsSearchDomains": [],
    "entryPoint": [],
    "linuxParameters": {
      "capabilities": {
        "add": null,
        "drop": null
      },
      "sharedMemorySize": null,
      "tmpfs": null,
      "devices": null,
      "initProcessEnabled": null
    },
    "environment": [
      {
        "name": "ENV",
        "value": "staging"
      }

scripts which set on docker image.

if [[ $ENV = staging ]]; then
  ...
fi
comments powered by Disqus