GithubHelp home page GithubHelp logo

Comments (8)

shirbr510 avatar shirbr510 commented on May 27, 2024

as far as it seems, nothing actually happens unless I'm actively running the nginx image...

I guess I'll need to run react-env --dest manually after all πŸ€·β€β™‚ πŸ˜„

from react-env.

andrewmclagan avatar andrewmclagan commented on May 27, 2024

Hi. You do not have to use the docker image. This is just to make life easier for those who want to deploy in a docker environment.

The core of this library is a node binary that builds the env.js environment file. That’s all you need. I’m not 100% familiar with deploying to s3... although the core question is: Do you even have environment variables available on s3?? My assumption would be no as you need a node runtime anyway not static js.

Please describe where your env bars come from / config.

from react-env.

shirbr510 avatar shirbr510 commented on May 27, 2024

well, it's basically the same
you solution revolves around hosting env.js file that you can access from window._env
same will happen if you host an env.js via an s3 bucket, it will work exactly the same

my point in my question is that it seems like you need more examples on how to build your images with various platforms (and obviously, support nginx OOTB)

I actually dug into the way you are using it in nginx and figured out how to implement it all rather neatly

the only thing that I'm missing is that our deployment flow isn't based on the NODE_ENV variable due to it's implication on node performance, so we rather use a variable called ENV or REACT_APP_ENV

as far as I can see, the only issue with this is this line: https://github.com/beam-australia/react-env/blob/6b1471fcca43b5863cfe22db2927bb0e492bab6c/packages/node/dist/cli-index.js#L7

from react-env.

andrewmclagan avatar andrewmclagan commented on May 27, 2024

That’s a great point we should add some more examples with docker, serverless etc...

We actually do the same. We have a variable called PLATFORM_ENV so we can still have node in production on our staging servers

from react-env.

andrewmclagan avatar andrewmclagan commented on May 27, 2024

Any thoughts on s3 documentation?

from react-env.

shirbr510 avatar shirbr510 commented on May 27, 2024

@andrewmclagan if that's the case, let's extract the NODE_ENV parameter to a cli parameter that can default to NODE_ENV πŸ˜„

I can try and open a PR for you :)

from react-env.

shirbr510 avatar shirbr510 commented on May 27, 2024

regarding S3 docs, there's not much to it tbh
the moment you get a dist that includes the correct env.js in the build folder, you should be good to go πŸ‘

I can try and make an example based on a very simple CRA πŸ˜„

but as you said, issues/goals for docs per common deployment way can be very nice πŸŽ‰

from react-env.

andrewmclagan avatar andrewmclagan commented on May 27, 2024

closing as stale

from react-env.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.