Find out how to use Infisical to inject environment variables into services defined in your Docker Compose file.
Prerequisites:
Follow this guide to configure the Infisical CLI for each service that you wish to inject environment variables into; you’ll have to update the Dockerfile of each service.
Generate a unique Infisical Token for each service.
For each service you want to inject secrets into, set an environment variable called INFISICAL_TOKEN
equal to a unique identifier variable.
In the example below, we set INFISICAL_TOKEN_FOR_WEB
and INFISICAL_TOKEN_FOR_API
as the INFISICAL_TOKEN
for the services.
Next, set the shell variables you defined in your compose file. This can be done manually or via your CI/CD environment. Once done, it will be used to populate the corresponding INFISICAL_TOKEN
in your Docker Compose file.
Find out how to use Infisical to inject environment variables into services defined in your Docker Compose file.
Prerequisites:
Follow this guide to configure the Infisical CLI for each service that you wish to inject environment variables into; you’ll have to update the Dockerfile of each service.
Generate a unique Infisical Token for each service.
For each service you want to inject secrets into, set an environment variable called INFISICAL_TOKEN
equal to a unique identifier variable.
In the example below, we set INFISICAL_TOKEN_FOR_WEB
and INFISICAL_TOKEN_FOR_API
as the INFISICAL_TOKEN
for the services.
Next, set the shell variables you defined in your compose file. This can be done manually or via your CI/CD environment. Once done, it will be used to populate the corresponding INFISICAL_TOKEN
in your Docker Compose file.