Deploying React within a Django scaffold

Priority: Normal
Project ID: 6473

Right now, I have it configured and running locally with a react production build moved within the django static folder. I’m thinking of updating the Dockerfile to add the react compile commands.

What is the correct approach for deployment?

Hi @MichaelSamonte, thanks for writing in!

You are going in the right direction. You should add the react compilation step just before the collectstatic command inside the Dockerfile. Make sure you also add the nodejs and other relevant dependencies to the Dockerfile.

I also encourage you to use Docker Compose for local development, all relevant files are already added to your repository.

It works great! Thanks!

1 Like

I’m glad it does, @MichaelSamonte. You are always welcome!

Let us know if there is anything else we can help you with.

Happy coding!