Static Site build issue

Hi there,

I am trying to deploy a static site. I specified a build command (npm install) and publish directory (./dist) all that works. After npm install is done (and has published everything I need to ./dist) it continues a python build because there is a requirements.txt in the root of the repo (I have both static assets and python code in same repo).

Is there a way to just run the build command I specify and not run any other “automatic” build processes?


Hi Rudolf,

For static sites, we run a pre-build phase ( runs before the build command is executed) that inspects the root of the repo and will install any dependencies specified in package.json, ruby gemfiles, or python requirements.txt files

One solution would be to set the SKIP_INSTALL_DEPS environment variable to true. Render will notice this env var and skip installing dependencies.

Another option is to change the directory structure to something like the following:

|__ node 
     |__ package.json   
|__ python 
    |__ requirements.txt

Then when you want to deploy just the node static site for example you can update the buildCommand to

cd node && npm install

For python you would update the build and start commands to account for the python subdirectory. Eg:

BuildCommand: cd python && pip install -r requirements.txt
StartCommand: cd python && gunicorn app:app