docker-compose restart总是不会发出运行命令

对于docker-compose,我有点新意,并且在理解重启选项时遇到了麻烦。 我有一个运行Jira的服务的容器,有时容器会因为各种原因而停止运行。 我觉得补充

restart: always 

会导致容器重新启动并运行该命令,但会重新启动,但不会运行compose命令。 这是我的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 

该选项的文档是严重缺乏,我正在运行docker1.9.1和docker-compose 1.5.2。 有没有人有这个成功?

编辑:

包含正在运行并构build的dockerfile可能会有帮助:

 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