--- title: "Docker Compose" --- ### Step 1: Add CLI to your Dockerfile Follow steps 1 through 3 on our [guide to configure Infisical CLI](/docker) in your Dockerfile. ### Step 2: Generate Infisical Token In order for Infisical CLI to authenticate and retrieve your project's secrets without exposing your login credentials, you must generate a Infisical Token. To learn how, visit [Infisical Token](../getting-started/cli/infisical-token). Once you have generated the token, keep it handy. If you have multiple services and they do not use the same secrets, you will have to generate a Infisical Token for each service. ### Step 3: Tell Docker Compose your Infisical Token For each service you want to inject secrets into, set an environment variable called `INFISICAL_TOKEN` equal to a useful shell variable name. This will ensure that you can set Infisical Tokens for multiple services. ```yaml # Example Docker Compose file services: web: build: . image: auledge-frontend container_name: auledge-frontend environment: - INFISICAL_TOKEN: ${INFISICAL_TOEKN_FOR_WEB} api: build: . image: auledge-backend container_name: auledge-backend environment: - INFISICAL_TOKEN: ${INFISICAL_TOEKN_FOR_API} ``` ### 4: Set shell variables Next, set the shell variables you defined in your compose file. This can be done manually or via your CI/CD environment. Once donce, it will be used to populate the corresponding `INFISICAL_TOKEN` in your Docker Compose file. ``` bash #Example # Token refers to the token we generated in step 2 for this service INFISICAL_TOEKN_FOR_WEB= # Token refers to the token we generated in step 2 for this service INFISICAL_TOEKN_FOR_API= ``` Then run your compose file in the same terminal. ```bash docker-compose ```