docker-compose restart always not issuing run command
I am somewhat new to docker-compose and am having trouble with understanding the restart option. I have a container that runs a service talking to Jira, sometimes the container will go down for a variety of reasons. I figured that adding
would cause the container to restart and run the command, however it restarts but never runs the compose command. Here is my docker-compose.yml
jira_service: container_name: jira_service hostname: jira_service working_dir: /auto_build extends: file: ./auto_build/common.yml service: auto_build command: bash -c "python init_db.py && python jira_service.py" links: - db restart: always volumes_from: - log_data
The documentation for this option is seriously lacking, I am running docker 1.9.1 and docker-compose 1.5.2. Has anyone had success with this?
It may be helpful to include the dockerfile that this is being run and built on:
FROM python:3.4 ADD . /auto_build WORKDIR /auto_build RUN apt-get update RUN apt-get install -y unixodbc-dev unixodbc odbc-postgresql RUN apt-get install -y python-psycopg2 RUN pip install -r requirements.txt RUN apt-get install -y git