Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5 .env variables not present #2964

Closed
k-flynn-webdev opened this issue Dec 31, 2022 · 2 comments
Closed

V5 .env variables not present #2964

k-flynn-webdev opened this issue Dec 31, 2022 · 2 comments

Comments

@k-flynn-webdev
Copy link

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 the default.json and custom-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_config

Actual behavior

.env file values do NOT override the node_config

System configuration

V5 featherjs brand new generated project

@k-flynn-webdev k-flynn-webdev changed the title V5 .env variables not prsent V5 .env variables not present Dec 31, 2022
@k-flynn-webdev
Copy link
Author

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```

@k-flynn-webdev
Copy link
Author

I now have a working V5 docker project. See above comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant