A script to start Docker Compose stacks with secrets injected from Infisical at runtime.
- Inject secrets from Infisical into Docker Compose at runtime
- Support for multiple environments (prod, dev, staging)
- Detached mode for background execution
- Auto-update functionality
- Simple configuration via
inf.envfile
curl -fsSL https://raw.githubusercontent.com/peterweissdk-priv/inf_docker/main/install_inf_docker.sh | bashThis installs inf_docker to /usr/local/bin/ and optionally generates a template inf.env file.
Run from a directory containing your docker-compose.yml:
inf_docker # Run in foreground (attached)
inf_docker -d # Run in detached mode (daemonized)
inf_docker -e dev # Override environment
inf_docker -p /my/path # Override secret path
inf_docker -d -e staging -p /staging/secrets # Combine options| Flag | Description |
|---|---|
-d |
Run docker compose in detached mode |
-e ENV |
Override Infisical environment (e.g. prod, dev, staging) |
-p SECRET_PATH |
Override Infisical secret path |
-u |
Check for updates and install if available |
-v |
Show version |
Create an inf.env file in your docker compose directory:
INF_ENV=prod
INF_SECRET_PATH=/your/secret/pathCommand-line arguments (-e, -p) take precedence over values in inf.env.
- Infisical CLI installed and authenticated
- Docker and Docker Compose
Install Infisical CLI (Debian/Ubuntu):
curl -1sLf 'https://artifacts-cli.infisical.com/setup.deb.sh' | sudo -E bash
sudo apt-get update && sudo apt-get install -y infisicalLogin to Infisical:
infisical loginInitialize a docker compose directory with Infisical:
cd /path/to/your/docker-compose-project
infisical inityour-project/
├── docker-compose.yml # Your Docker Compose configuration
├── inf.env # inf_docker configuration (INF_ENV, INF_SECRET_PATH)
└── .infisical.json # Infisical project config (created by `infisical init`)
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or need support, please file an issue on the GitHub repository.
This project is licensed under the GNU GENERAL PUBLIC LICENSE v3.0 - see the LICENSE file for details