-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for PM2 integration, update Docker/Docker-Compose integratio…
…n docs
- Loading branch information
1 parent
a94cd8c
commit 76d0127
Showing
5 changed files
with
86 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: "PM2" | ||
description: "How to use Infisical to inject environment variables and secrets with PM2 into a Node.js app" | ||
--- | ||
|
||
Prerequisites: | ||
|
||
- Set up and add envars to [Infisical Cloud](https://app.infisical.com) | ||
- [Install the CLI](/cli/overview) | ||
|
||
## Initialize Infisical for your Node.js app | ||
|
||
```bash | ||
# navigate to the root of your of your project | ||
cd /path/to/project | ||
|
||
# then initialize infisical | ||
infisical init | ||
``` | ||
|
||
## Create a bash or js script | ||
|
||
<CodeGroup> | ||
|
||
```bash infisical-run.sh | ||
infisical run -- npm start | ||
``` | ||
|
||
```js infisical-run.js | ||
const spawn = require("child_process").spawn; | ||
|
||
const infisical = spawn("infisical", ["run", "--", "npm", "start"]); | ||
|
||
infisical.stdout.on("data", (data) => console.log(`${data}`)); | ||
infisical.stderr.on("data", (data) => console.error(`${data}`)); | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## Start your application as usual but with the script | ||
|
||
<CodeGroup> | ||
|
||
```bash infisical-run.sh | ||
pm2 start infisical-run.sh | ||
``` | ||
|
||
```bash infisical-run.js | ||
pm2 start infisical-run.js | ||
``` | ||
|
||
</CodeGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters