Skip to content

🐳 .env → docker-compose Environment

Paste the contents of a .env file to convert it into a docker-compose.yml environment block, in either list or dict YAML style.

✅ 100% free, no signup, runs entirely in your browser

🔒 Privacy guaranteed: Your .env contents (including API keys and passwords) are never uploaded. All conversion happens entirely inside your browser.

🔗 Related Tools

📖 How to Use

  1. 1
    Paste your .env
    Paste your .env file contents into the left input. Lines starting with # are treated as comments.
  2. 2
    Choose output format
    Pick list ( - KEY=value ) or dict ( KEY: value ) format, and optionally rewrite secrets to ${VAR} references.
  3. 3
    Copy the result
    The converted block appears on the right. Copy it and paste it under the environment key of your docker-compose.yml.

❓ FAQ

Which keys trigger the secret warning?
Keys whose name includes PASSWORD, SECRET, KEY, TOKEN, API_KEY, or PRIVATE trigger the warning.
How are quotes and escapes handled?
Single- or double-quoted values are unquoted. When a value contains YAML-special characters such as : or #, the output is re-quoted automatically.
Does it support variable expansion like $OTHER?
Values are written as-is. docker-compose itself resolves ${VAR} references at runtime, so no literal expansion is performed here.