How to run 'pip install...' in action server container?

Hi, this is my docker-compose.yml:

version: '3.0'
services:
  rasa:
    image: rasa/rasa:1.4.0-full
    container_name: rasa-1.4.0
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    command:
      - run
  action_server:
    image: rasa/rasa-sdk:1.4.0
    container_name: rasa-action-server
    volumes:
      - ./actions:/app/actions

if I add command: run pip install redis into action_server, library is being downloaded but then container stops.

rasa-action-server | Collecting redis
rasa-action-server |   Downloading https://files.pythonhosted.org/packages/32/ae/28613a62eea0d53d3db3147f8715f90da07667e99baeedf1010eb400f8c0/redis-3.3.11-py2.py3-none-any.whl (66kB)
rasa-action-server | Installing collected packages: redis
rasa-action-server | Successfully installed redis-3.3.11
rasa-action-server exited with code 0

I’ve tried many different solutions but everytime I’m getting

rasa-action-server | Available options:
rasa-action-server |  start  - Start Rasa Action Server
rasa-action-server |  help   - Print this help
rasa-action-server |  run    - Run an arbitrary command inside the container

Does anyone know how to run pip install in action server container properly?

There is a solution: https://rasa.com/docs/rasa/user-guide/running-rasa-with-docker/#adding-custom-dependencies

Can you explain your solution please?