db:
    image: mysql
    environment:
        MYSQL_ROOT_PASSWORD: ting
        MYSQL_DATABASE: ting

api:
    build: .
    dockerfile: Dockerfile-api
    command: sh -c "python manage.py migrate && echo 'migrated' && python manage.py runserver 0.0.0.0:8000"
    links:
        - db

realtime:
    image: node
    volumes:
        - .:/usr/src/app/
    working_dir: /usr/src/app/
    expose:
        - "8080"
    ports:
        - "8080:8080"
    command: sh -c "npm install && ./node_modules/bower/bin/bower --allow-root install && node server.js"
    links:
        - front

front:
    image: nginx
    volumes:
        - config/nginx.conf:/etc/nginx/conf.d/default.conf:ro
        - .:/usr/src/app/
    ports:
        - "80:80"
    links:
        - api

db:
    image: mysql
    environment:
        MYSQL_ROOT_PASSWORD: ting
        MYSQL_DATABASE: ting

api:
    build: .
    dockerfile: Dockerfile-api
    command: sh -c "python manage.py migrate &&
        python manage.py runserver 0.0.0.0:8000"
    links:
        - db

realtime:
    image: node
    volumes:
        - .:/usr/src/app/
    working_dir: /usr/src/app/
    expose:
        - "8080"
    ports:
        - "8080:8080"
    command: sh -c "npm install && 
        ./node_modules/bower/bin/bower --allow-root install &&
        node server.js"
    links:
        - front

front:
    image: nginx
    volumes:
        - config/nginx.conf:/etc/nginx/conf.d/default.conf:ro
        - .:/usr/src/app/
    ports:
        - "80:80"
    links:
        - api

Split big commands in multiple lines
Split big commands in multiple lines
