Comments (8)
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.
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.
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.
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.
Any thoughts on s3 documentation?
from react-env.
@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.
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.
closing as stale
from react-env.
Related Issues (20)
- how to pass env variables from docker compose HOT 2
- Possible improvement on Docker support HOT 1
- NextJs build step
- NextJS + Dockerfile HOT 1
- Incorrect type definitions for env function
- Default ENV behaviour misaligned with NextJS
- CRA Docker example gone HOT 3
- Question HOT 3
- How to pick specific .env file? HOT 3
- Can this be used to pass env vars to docker container for NGINX? HOT 2
- window.__ENV undefined HOT 1
- Cache Busting HOT 3
- Broken Docker image on Docker Hub HOT 2
- Feedback/Docker Usage HOT 3
- window.__ENV not available HOT 1
- Please add documentation to the readme about importing __ENV file in the index.html HOT 1
- Improvement ideas and caveats HOT 1
- Usage with Jest and Storybook HOT 2
- feature request - load vars from single json file like env-cmd HOT 1
- Docker Error: EACCES: permission denied, open '/app/public/__ENV.js HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-env.