I have a build file that looks like this:
#!/usr/bin/env bash
set -o errexit
mkdir -p /opt/render/.postgresql/
if [ ! -f /opt/render/.postgresql/root.crt ]; then
cp /etc/secrets/postgresql-root.crt /opt/render/.postgresql/root.crt
fi
pip install -U pip
pip install -r requirements.txt
python manage.py collectstatic --no-input
mkdir -p staticfiles
python manage.py migrate
My render.yaml
looks like this:
services:
- type: web
name: backend
env: python
buildCommand: "./build.sh"
startCommand: "gunicorn backend.wsgi:application"
Whenever I deploy, .postgresql/root.crt
get’s wiped. I can verify the file does exist in /etc/secrets/
, and when I manually copy it in the command-line post deploy everything works again.
Is there some type of gotcha around creating files & folders in /opt/render/
? Is there some type of “post-build” step or should I move this to the start command?
Thanks!