Commands in docker-compose.yml?

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 && / db createdb && / db migrate && echo 'running' && / 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!

Hey Michael,

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 file doing? We let you override the Docker CMD and 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

and this is what my file looks like

Basically, I need to set up the DB but not sure where to put the sh -c "sleep 10 && / db createdb && / db migrate && echo 'running' && / run" command in Render.

Thanks for the help!

For context, I tried putting sleep 10 && / db createdb && / db migrate && echo 'running' && / 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

Hey Michael,

You can create an entry point script with the following content:

#!/bin/bash sleep 10 ./ db createdb ./ db migrate echo 'running' ./ run

And run it with the following command for example sh -c ./

Render Support, UTC+3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.