$STACK_PATH is empty after successful deployment

Hello,

I’m working on a dockerised rails app My build works without any error, deployment seems fine, app container fails running. The db isn’t setup (create/migrate…) which explains why the app container cannot work properly.

I followed the guide to ssh my app server with toolbelt, then when I tried cd $STACK_PATH I ended up in an empty folder I cannot run rails console.

What am I missing?

Any suggestions?

I tried to run my command (db:migrate) with the toolbelt on container, but as my container won’t start so I can’t run migration.

The problem seems to come from the fact that the container won’t start if the migrations aren’t done (endless circle).

I try to add a CMD rake db:migrate in the Dockerfile without success.

Here is my actual work around: ssh to server docker run -it my_image bash run command with copying all the ENV_VAR I need (There must be a better way to do it) migration done exit restart the container

Hi,

You’d need to use deploy_command. This means that each time you deploy a container from your service will be fired up and run this command and dies after the command finishes.

http://help.cloud66.com/building-your-stack/docker-service-configuration

Hi, Thanks for your answer. Yes using services is much more easier!

You must be logged in to answer this question