Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
luanc202L

luanc202

@luanc202
About
Posts
4
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • add custom javascript to cloudron dashboard
    luanc202L luanc202

    that would be nice even if it's not for a chatwoot or any other chat widget, analytics and other scripts can make good use of that.

    hope we get that feature soon.

    Feature Requests

  • OctoBot - Cryptocurrency trading bot using technical analysis
    luanc202L luanc202

    Docker Image:
    https://hub.docker.com/r/drakkarsoftware/octobot

    Homepage:
    https://www.octobot.online/

    Github:
    https://github.com/Drakkar-Software/OctoBot


    OctoBot is a trading robot which is designed to be easy to use and infinitely customizable.

    OctoBot is built for people who don't have much time or do not easily trust the crypto-world projects. Many trading automation tools exist but most of them are complicated to use, expensive, do not behave as intended or are meant to be used by profesional traders.

    App Wishlist

  • How do I make a node app load variables from .env?
    luanc202L luanc202

    Just solved it by adding

    RUN ln -sf /app/data/env /app/code/.env
    

    to my Dockerfile, my env is linked in the code folder and works as intended.

    this topic may now be closed.

    Support

  • How do I make a node app load variables from .env?
    luanc202L luanc202

    I am testing some things with a custom node app for Cloudron, one of these tests is making my app load environment variables from my .env file, I've tried setting variables from cloudron cli and it worked, but for my application I really do need to load them from a file.

    What I've tried:

    Setting dotenv path manually in my server.js file as

    require('dotenv').config({ path: '../data/.env' })
    

    But did not work, also tried at the start.sh when node is called as

    node -r dotenv/config your_script.js dotenv_config_path=../data/.env
    

    Did not work either, my program was not able to load my file and when my code ran

    console.log(process.env)
    

    I was only getting the cloudron variables such as CLOUDRON_API_ORIGIN, PATH, CLOUDRON_APP_HOSTNAME,
    CLOUDRON and many others.

    So, my question is, how do I make my nodejs app load my environment variables from a .env file located in the /app/data folder? If that is even possible.

    I tried searching for that here on the forum but I could not find an answer for that specific problem.

    Support
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search