Restructure docs around new anchors

This commit is contained in:
Tuan Dang
2022-11-27 23:36:50 -05:00
parent 798eb67296
commit 0a9f4ffc4d
11 changed files with 132 additions and 144 deletions

View File

@@ -2,11 +2,13 @@
title: "Docker Compose"
---
### Step 1: Add CLI to your Dockerfile
The Docker Compose integration enables you to inject environment variables from Infisical into the containers defined in your compose file.
Follow steps 1 through 3 on our [guide to configure Infisical CLI](../getting-started/cli/installation) in your Dockerfile.
## Add the CLI to your Dockerfile(s)
### Step 2: Generate Infisical Token
Follow steps 1 through 3 on our [guide to configure Infisical CLI](../integrations/docker) in your Dockerfile.
## 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.
@@ -16,7 +18,7 @@ To learn how, visit [Infisical Token](../getting-started/cli/infisical-token). O
have to generate a Infisical Token for each service.
</Info>
### Step 3: Tell Docker Compose your Infisical Token
## 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 helpful identifier variable.
This will ensure that you can set Infisical Tokens for multiple services.
@@ -41,7 +43,7 @@ services:
- INFISICAL_TOKEN=${INFISICAL_TOKEN_FOR_API}
```
### 4: Export shell variables
## Export 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 done, it will be used to populate the corresponding `INFISICAL_TOKEN`
in your Docker Compose file.

View File

@@ -2,7 +2,9 @@
title: "Docker"
---
## Step 1: Add CLI to your Dockerfile
The Docker integration enables you to inject environment variables from Infisical into a container.
## Add the CLI to your Dockerfile
<Tabs>
<Tab title="Alpine">
@@ -29,14 +31,10 @@ title: "Docker"
</Tab>
</Tabs>
## Step 2: Generate Infisical Token
[Generate an Infisical Token](../../getting-started/dashboard/token) and keep it handy.
## Step 3: Set start command of your container
## Modify the start command in your Dockerfile
```dockerfile
CMD ["infisical", "--env=[your-project-env-name]", "projectId=[your-project-id]", "run", "---", "<your application start command>"]
CMD ["infisical", "--env=[env]", "projectId=[projectId]", "run", "---", "[your application start command]"]
# example
CMD ["infisical", "--env=prod", "projectId=62faf98ae0b05e83239b5da41", "run", "---", "npm run start"]
@@ -49,12 +47,14 @@ Required options:
| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` |
| `--projectId` | Used to link a local project to the platform | `None` |
## Step 4: Feed Docker your Infisical Token
## Generate an Infisical Token
The CLI looks out for an environment variable called the `INFISICAL_TOKEN` which you can set depending on where you run the CLI. If `INFISICAL_TOKEN` is detected by the CLI, it will authenticate and retrieve the environment variables which the token is authorized for.
[Generate an Infisical Token](../../getting-started/dashboard/token) and keep it handy.
## Feed Docker your Infisical Token
The CLI looks out for an environment variable called `INFISICAL_TOKEN`. If the token is detected, the CLI will authenticate, retrieve, and inject the environment variables which the token is authorized for.
```bash
docker run --env INFISICAL_TOKEN=[the-token-you-got-from-step-2]...
docker run --env INFISICAL_TOKEN=[token]...
```
Note: `INFISICAL_TOKEN` is the token you generated in step 2.

View File

@@ -2,7 +2,7 @@
title: "Overview"
---
Integrations allow environment variables to be synced across your entire infrastructure from local development to CI/CD and production.
Integrations allow environment variables to be synced from Infisical into your local development workflow, CI/CD pipelines, and production infrastructure.
Missing an integration? Throw in a [request](https://github.com/Infisical/infisical/issues).