Hello! So I’m pretty confused on how to use Docker with Render (and how to use Docker!)
I have a command in my docker-compose.yml file that looks like
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && echo 'running' && /entrypoint.sh run"
My question is: Where do I add this to run in Render web-service for my Docker web-service? I put this into the Pre-Deploy Command but that didn’t seem to work (I just got errors). Any help would be appreciated!
It’s a little difficult to know where each command should go without knowing what you intend to you with this service. What does your
docker-compose.yml look like? What is your
entrypoint.sh file doing? We let you override the Docker
ENTRYPOINT commands in your service via the ‘Docker Command’ option.
Render Support, UTC+3
Hey Jeremy! Thanks for the response. I’m sure it’s something I’m doing wrong.
This is what my docker-compose.yml looks like https://github.com/papercups-io/papercups/blob/6a6f5adc7f0cef5813b2c2f1c0659922defaf976/docker-compose.yml#L10
and this is what my entrypoint.sh file looks like https://github.com/papercups-io/papercups/blob/6a6f5adc7f0cef5813b2c2f1c0659922defaf976/docker-entrypoint.sh
Basically, I need to set up the DB but not sure where to put the
sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && echo 'running' && /entrypoint.sh run" command in Render.
Thanks for the help!
For context, I tried putting
sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && echo 'running' && /entrypoint.sh run into the Pre-deploy and it would give an error
==> Pre-deploy has failed
sleep: invalid number ‘&&’
which is pretty weird.
I’m like 80% sure the command should be in pre-deploy (or deploy) because this is setting up the DB and then running the service
You can create an entry point script with the following content:
#!/bin/bash sleep 10 ./entrypoint.sh db createdb ./entrypoint.sh db migrate echo 'running' ./entrypoint.sh run
And run it with the following command for example
sh -c ./docker-entrypoint.sh
Render Support, UTC+3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.