Closed k-flynn-webdev closed 1 year ago
Solved by updated my docker file with a -env node_config=xxx
build: .
image: node-app
container_name: node-app-dev
ports:
- '${PORT}:${PORT}'
environment:
- NODE_CONFIG={ "host":"${HOST}", "port":${PORT}, "postgresql":{ "client":"pg", "connection":"postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"} }
depends_on:
- database-layer
volumes:
- .:/usr/src/node-app
networks:
- shared-network
restart: on-failure```
I now have a working V5 docker project. See above comment.
Steps to reproduce
I've looked in the new guides and the node_config but I can't find a solution (hopefully just a mis-read)
I want to override the default.json with some variables from a
.env
file in the root of the project. So far i've had no luck i'm assuming the.env
is not actually read? I've tried using the .env variable name as a value in both thedefault.json
andcustom-enviroment-variables.json
but no joy the value never matches the.env
file.My use case is replacing the port and host values with a
.env
file thats shared between docker setups as well as for local running.Expected behavior
.env
file to be used as an override for the node_configActual behavior
.env
file values do NOT override the node_configSystem configuration
V5 featherjs brand new generated project