# Building a Rasa Assistant in Docker

If you don’t have a Rasa project yet, you can build one in Docker without having to install Rasa Open Source on your local machine. If you already have a model you’re satisfied with, see [Deploying Your Rasa Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/how-to-deploy/#deploying-your-rasa-assistant) to learn how to deploy your model.

- [Installing Docker](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#installing-docker)
- [Setting up your Rasa Project](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#setting-up-your-rasa-project)
- [Talking to Your Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#talking-to-your-assistant)
- [Training a Model](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#training-a-model)
- [Customizing your Model](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#customizing-your-model)
  - [Choosing a Tag](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#choosing-a-tag)
  - [Adding Custom Components](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#adding-custom-components)
  - [Adding Custom Actions](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#adding-custom-actions)
- [Deploying your Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#deploying-your-assistant)

## [Installing Docker](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id2)
If you’re not sure if you have Docker installed, you can check by running:

> ```
> docker -v
> # Docker version 18.09.2, build 6247962
> ```  
If Docker is installed on your machine, the output should show you your installed versions of Docker. If the command doesn’t work, you’ll have to install Docker. See [Docker Installation](https://docs.docker.com/install/) for details.

## [Setting up your Rasa Project](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id3)
Just like in the [tutorial](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/#rasa-tutorial), you’ll use the `rasa init` command to create a project. The only difference is that you’ll be running Rasa inside a Docker container, using the image `rasa/rasa`. To initialize your project, run:

> ```
> docker run -v $(pwd):/app rasa/rasa:1.10.24-full init --no-prompt
> ```

What does this command mean?
- `-v $(pwd):/app` mounts your current working directory to the working directory in the Docker container.
- `rasa/rasa` is the name of the docker image to run.

Running this command will produce a lot of output. What happens is:
- a Rasa project is created
- an initial model is trained using the project’s training data.

To check that the command completed correctly, look at the contents of your working directory:

> ```
> ls -1
> ```

The initial project files should all be there, as well as a `models` directory that contains your trained model.

## [Talking to Your Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id4)
To talk to your newly-trained assistant, run this command:

> ```
> docker run -it -v $(pwd):/app rasa/rasa:1.10.24-full shell
> ```

## [Training a Model](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id5)
If you edit the NLU or Core training data or edit the `config.yml` file, you’ll need to retrain your Rasa model. You can do so by running:

> ```
> docker run -v $(pwd):/app rasa/rasa:1.10.24-full train --domain domain.yml --data data --out models
> ```

## [Customizing your Model](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id6)
### [Choosing a Tag](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id7)
All `rasa/rasa` image tags start with a version number. The current version is 1.10.24. The tags are:
- `{version}`
- `{version}-full`
- `{version}-spacy-en`
- `{version}-spacy-de`
- `{version}-mitie-en`

## [Adding Custom Components](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id8)
If you are using a custom NLU component or policy in your `config.yml`, you have to add the module file to your Docker container.

### [Adding Custom Actions](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id9)
To create more sophisticated assistants, you will want to use [Custom Actions](https://legacy-docs-v1.rasa.com/1.10.24/core/actions/#custom-actions).

## [Deploying your Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/docker/building-in-docker/#id10)
Work on your bot until you have a minimum viable assistant that can handle your happy paths. After that, you’ll want to deploy your model to get feedback from real test users.
