Skip to content

Commit

Permalink
scripts: add env vars to api
Browse files Browse the repository at this point in the history
- NODE_ENV for prod vs dev
- ACCESS_CONTROL_ALLOW_ORIGIN for cors headers
  • Loading branch information
laurenzhonauer committed Sep 15, 2021
1 parent a8bfed6 commit 425ba23
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions scripts/development/.env_example_full
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ RPC_PASSWORD=s750SiJnj50yIrmwxPnEdSzpfGlTAHzhaUwgqKeb0G1j
MULTICHAIN_DIR="/root"
ROOT_SECRET=root-secret
SWAGGER_BASEPATH=/test
NODE_ENV=development
ACCESS_CONTROL_ALLOW_ORIGIN=*
#ENCRYPTION_PASSWORD=MyPassword

## frontend
Expand All @@ -88,6 +90,7 @@ EMAIL_HOST=email-service
EMAIL_PORT=8890
STORAGE_SERVICE_HOST=localhost
STORAGE_SERVICE_PORT=8090
INLINE_RUNTIME_CHUNK=false

##excel-export
ACCESS_CONTROL_ALLOW_ORIGIN=*
Expand Down
3 changes: 3 additions & 0 deletions scripts/development/.env_example_slim
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ RPC_PASSWORD=s750SiJnj50yIrmwxPnEdSzpfGlTAHzhaUwgqKeb0G1j
MULTICHAIN_DIR="/root"
ROOT_SECRET=root-secret
SWAGGER_BASEPATH=/test
NODE_ENV=development
ACCESS_CONTROL_ALLOW_ORIGIN=*
#ENCRYPTION_PASSWORD=MyPassword

## frontend
Expand All @@ -87,6 +89,7 @@ EMAIL_HOST=email-service
EMAIL_PORT=8890
STORAGE_SERVICE_HOST=localhost
STORAGE_SERVICE_PORT=8090
INLINE_RUNTIME_CHUNK=false

##excel-export
ACCESS_CONTROL_ALLOW_ORIGIN=*
Expand Down
3 changes: 3 additions & 0 deletions scripts/development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ services:
ORGANIZATION_PRIVATE_KEY: ${ORGANIZATION_PRIVATE_KEY}
ENCRYPTION_PASSWORD: ${ENCRYPTION_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
NODE_ENV: ${NODE_ENV}
ACCESS_CONTROL_ALLOW_ORIGIN: ${ACCESS_CONTROL_ALLOW_ORIGIN}
command: ["npm", "run", "watch"] # npm run watch: hot reloading
# volume to track code changes
volumes:
Expand Down Expand Up @@ -171,6 +173,7 @@ services:
EMAIL_PORT: ${EMAIL_PORT}
EXPORT_PORT: ${EXPORT_PORT}
EXPORT_HOST: ${EXPORT_HOST}
INLINE_RUNTIME_CHUNK: ${INLINE_RUNTIME_CHUNK}
# volume for hot reloading
volumes:
- "../../frontend/src:/app/src"
Expand Down
3 changes: 3 additions & 0 deletions scripts/operation/.env_example
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ RPC_PASSWORD=s750SiJnj50yIrmwxPnEdSzpfGlTAHzhaUwgqKeb0G1j
MULTICHAIN_DIR="/root"
ROOT_SECRET=root-secret
SWAGGER_BASEPATH=/test
NODE_ENV=production
ACCESS_CONTROL_ALLOW_ORIGIN=*
#ENCRYPTION_PASSWORD=MyPassword

## frontend
NODE_ENV=production
REACT_APP_VERSION=$npm_package_version
EXPORT_HOST=excel-export-service
EXPORT_PORT=8888
INLINE_RUNTIME_CHUNK=false

##excel-export
ACCESS_CONTROL_ALLOW_ORIGIN=*
Expand Down
7 changes: 6 additions & 1 deletion scripts/operation/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ services:
ORGANIZATION_PUBLIC_KEY: ${ORGANIZATION_PUBLIC_KEY}
ORGANIZATION_PRIVATE_KEY: ${ORGANIZATION_PRIVATE_KEY}
ENCRYPTION_PASSWORD: ${ENCRYPTION_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
SWAGGER_BASEPATH: /test
JWT_SECRET: ${JWT_SECRET}
NODE_ENV: ${NODE_ENV}
ACCESS_CONTROL_ALLOW_ORIGIN: ${ACCESS_CONTROL_ALLOW_ORIGIN}
depends_on:
- master-node
ports:
Expand Down Expand Up @@ -117,6 +119,8 @@ services:
TEST_API_HOST: master-api
TEST_API_PORT: ${API_PORT}
PORT: ${EXPORT_PORT}
JWT_SECRET: ${JWT_SECRET}
MODE: DEBUG
ports:
- "${EXPORT_PORT}:${EXPORT_PORT}"
# - "9231:9229"
Expand Down Expand Up @@ -157,6 +161,7 @@ services:
EMAIL_PORT: ${EMAIL_PORT}
EXPORT_PORT: ${EXPORT_PORT}
EXPORT_HOST: ${EXPORT_HOST}
INLINE_RUNTIME_CHUNK: ${INLINE_RUNTIME_CHUNK}
depends_on:
- master-api
ports:
Expand Down

0 comments on commit 425ba23

Please sign in to comment.