Skip to content
New issue

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

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

Already on GitHub? # to your account

docker deploy #2745

Closed
abdalla opened this issue Jul 7, 2017 · 3 comments
Closed

docker deploy #2745

abdalla opened this issue Jul 7, 2017 · 3 comments

Comments

@abdalla
Copy link

abdalla commented Jul 7, 2017

Hey Guys,

I'm using create-react-app for my projects using docker as my dev env.

Now I would like to know how is the best practice to deploy my project into AWS (I'll deploy the docker).

Maybe my question is a dummy but I'm really stuck on it.

My docker file has a command yarn start... for dev it is enough I don't need to build anything, my bundle will run in memory, but for QA or PROD I would like to build using npm run build but as I know it will create a new folder with the files that should be used on prod env.

That said, my question is: what is the best practice for this kind of situation?

Thanks.

@Timer
Copy link
Contributor

Timer commented Jul 7, 2017

Hi! Unfortunately we aren't experts in advising for this sort of thing.
You'd be better asking this on Stack Overflow or similar.

Please see our Deployment section for the various guides we have.

Perhaps the S3 and CloudFront guide will suit you.
You shouldn't deploy an entire container to serve static content -- just the files.

You can also checkout Now and others in that section.

Cheers!

@Timer Timer closed this as completed Jul 7, 2017
@nazreen
Copy link

nazreen commented Oct 7, 2017

@abdalla you should only upload the static files generate from npm run build. if you're using AWS S3, upload to the relevant buckets.
I assume that for each environment (staging, prod) you have different branches. you can create different scripts that you run that targets the respective buckets or environments.
i.e. when you are on your dev branch, you run your script that builds then uploads to QA/staging bucket.
when you are in your master/prod branch, you run the scripts that builds then uploads to the prod bucket.

@abdalla
Copy link
Author

abdalla commented Oct 13, 2017

Hey there..

Thanks for your answer and help, but what I'm looking for is to deploy my container with my app built, does it make sense?

I got a good answer for it on StackOverflow ( https://stackoverflow.com/questions/44981427/create-react-app-docker-qa-and-prod-deploy/44981792#44981792 ) and it worked fine for me.

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants