Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Feat/dotenv5 #1337

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ EXPOSE 3000
EXPOSE 3005
WORKDIR /opt/one-app
USER $USER
CMD ["node", "--dns-result-order=ipv4first", "--no-experimental-fetch", "lib/server"]
CMD ["node", "--dns-result-order=ipv4first", "--no-experimental-fetch", "--require=dotenv/config", "lib/server"]
COPY --from=builder --chown=node:node /opt/one-app/production ./
18 changes: 18 additions & 0 deletions docs/api/server/Environment-Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@ One App can be configured via Environment Variables:

> ⚠️ = Required

## `DOTENV_CONFIG_PATH`

One App supports the usage of [Dotenv](https://github.com/motdotla/dotenv). This environment variable allows you to specify the path to the `.env` file that should be loaded. These values are loaded before the start of the One App server. See the documentation for Dotenv for advanced usage. Dotenv will look for `.env` by default if this is not set.

**Runs In**
* ✅ Production
* ✅ Development

**Shape**
```bash
DOTENV_CONFIG_PATH=String
```

**Example**
```bash
DOTENV_CONFIG_PATH=.env
```

## `HOLOCRON_MODULE_MAP_URL`

⚠️ Required In Production
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"monitor:performance": "docker-compose -f ./__performance__/docker-compose.yml up --abort-on-container-exit influxdb grafana prometheus",
"test:lockfile": "lockfile-lint -p package-lock.json -t npm -a npm -o https: -c -i",
"test:lint": "eslint --ext js,jsx,md,snap .",
"start": "node --dns-result-order=ipv4first --no-experimental-fetch lib/server/index.js",
"start:inspect": "node --inspect --expose-gc lib/server/index.js",
"start": "node --dns-result-order=ipv4first --no-experimental-fetch --require=dotenv/config lib/server/index.js",
"start:inspect": "node --inspect --expose-gc --require=dotenv/config lib/server/index.js",
"test:unit": "jest --testPathIgnorePatterns integration --config jest.config.js",
"pretest:integration": "concurrently \"npm run build:prod-sample\" \"docker-compose -f ./prod-sample/docker-compose.yml pull nginx selenium-chrome\" --kill-others-on-fail -n build-prod-sample,build-dependency-images",
"test:integration": "JEST_TEST_REPORT_PATH=./test-results/integration-test-report.html jest integration --config jest.integration.config.js --forceExit",
Expand Down Expand Up @@ -105,6 +105,7 @@
"cors": "^2.8.5",
"create-shared-react-context": "^1.0.3",
"cross-fetch": "^3.0.6",
"dotenv": "^16.4.5",
"express": "^4.17.1",
"express-prom-bundle": "^6.6.0",
"flat": "^5.0.2",
Expand Down
2 changes: 1 addition & 1 deletion prod-sample/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version: '3'
services:
one-app:
env_file: ./one-app/base.env
entrypoint: sh -c 'sleep 2s && node lib/server'
entrypoint: sh -c 'sleep 2s && node --require=dotenv/config lib/server'
2 changes: 1 addition & 1 deletion prod-sample/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
- extra-slow-api
- nginx
env_file: ./one-app/base.env
entrypoint: sh -c 'sleep 2s && node lib/server'
entrypoint: sh -c 'sleep 2s && node --require=dotenv/config lib/server'
fast-api:
build:
context: ./api
Expand Down
Loading