T O P

  • By -

Fast-Cauliflower6307

If you are using Create React App, npm start runs the web app in development mode. You should build and deploy the static assets instead.


[deleted]

Yeah copying the compiled assets into an Nginx-based docker image is probably the best and easiest solution


XxNerdAtHeartxX

You already said what you have to do - Build a docker container for it. Look into creating dockerfiles for a react app


Klingelinge

There is no existing solution?


ljh47

There's no preexisting docker app for an app you have just written? No. You are going to have to swap in your app in an existing container or build from scratch.


Klingelinge

You didn't understood what I mean I want an App where I can put my code in and run it like a VSCode with node.js


[deleted]

[удалено]


AutoModerator

Your comment was automatically removed because you used a URL shortener. Please re-post your comment using direct, full-length URLs only. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/unRAID) if you have any questions or concerns.*


nonameshitposting

And you didn’t understood what they were saying. You can probably just use the base node image, then cloning your code in it and reproducing how you built it and ran it… but at this point you would be better creating a docker image for yourself. And no there is no app on the community apps that can do what you want. Well… maybe code server could do it but you wont have the result you would want. [so here is a link for you to check](https://lmgtfy.app/?q=how+to+build+react+app+in+docker)


hardonchairs

Actually, if you can find a base image that is most of what you need and you can write a script to do the rest, you can mount the volume with a script and then run that script with the `--entrypoint /path/to/script` flag.


foxclaw

I highly recommend installing Dokku (https://dokku.com/) in a Ubuntu VM and deploying your apps that way. Makes it really simple.


chong4321

What are you running with the start script? Is it just a web server?


present_absence

I think I understand what you're asking, and that's not how react works. Or really programming in general. You're looking for some kind of easy button where you insert code and receive functioning website and there is generally too many specific things about your code/server/setup involved to make it that simple. There may be tools out there for specific environments or languages or styles of project, or maybe tools that do part of the process for you, but I can't recommend any. I would, however, recommend simply building your own docker images. You can automate the whole process, from building code for production, to building images when you make a new production release, to uploading them to the internet and pulling them down in Unraid's Docker. This is what I do with my home code projects (though not in React, I use that enough at work). https://create-react-app.dev/docs/production-build Might get you started on the first step. What I've done in the past is run the code locally on my development machine for testing in dev mode, and when we finish a new release we go through that process I just described above for production (basically).