🐳 .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.
⚠️ Secret warning
These keys look like secrets. Do not commit them directly into docker-compose.yml — use a ${VAR} reference and load them via an .env file instead.
🔗 Related Tools
📖 How to Use
-
1
Paste your .envPaste your .env file contents into the left input. Lines starting with # are treated as comments.
-
2
Choose output formatPick list ( - KEY=value ) or dict ( KEY: value ) format, and optionally rewrite secrets to ${VAR} references.
-
3
Copy the resultThe 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.