# Deploying a Rasa Open Source Assistant in Docker Compose

If you would like to deploy your assistant without Rasa X, you can do so by deploying it in Docker Compose.
To deploy Rasa X and your assistant together, see the [Recommended Deployment Methods](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/how-to-deploy/#recommended-deployment-methods).

## [Installing Docker](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/docker/deploying-in-docker-compose/#id2)

If you’re not sure if you have Docker installed, you can check by running:

```
docker -v && docker-compose -v
# Docker version 18.09.2, build 6247962
# docker-compose version 1.23.2, build 1110ad01
```

If Docker is installed on your machine, the output should show you your installed versions of Docker and Docker Compose. If the command doesn’t work, you’ll have to install Docker. See [Docker Installation](https://docs.docker.com/install/) for details.

## [Configuring Channels](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/docker/deploying-in-docker-compose/#id3)

To run your AI assistant in production, don’t forget to configure your required [Messaging and Voice Channels](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/messaging-and-voice-channels/#messaging-and-voice-channels) in `credentials.yml`. For example, to add a REST channel, uncomment this section in the `credentials.yml`:

```
rest:
  # you don't need to provide anything here - this channel doesn't
  # require any credentials
```

The REST channel will open your bot up to incoming requests at the `/webhooks/rest/webhook` endpoint.

## [Using Docker Compose to Run Multiple Services](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/docker/deploying-in-docker-compose/#id4)

Docker Compose provides an easy way to run multiple containers together without having to run multiple commands or configure networks. This is essential when you want to deploy an assistant that also has an action server.

Start by creating a file called `docker-compose.yml`:

```
touch docker-compose.yml
```

Add the following content to the file:

```
version: '3.0'
services:
  rasa:
    image: rasa/rasa:1.10.18-full
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    command:
      - run
```

The file starts with the version of the Docker Compose specification that you want to use.
Each container is declared as a `service` within the `docker-compose.yml`. The first service is the `rasa` service, which runs your Rasa server.

To add the action server, add the image of your action server code. To learn how to deploy an action server image, see [Building an Action Server Image](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/how-to-deploy/#building-an-action-server-image).

```
version: '3.0'
services:
  rasa:
    image: rasa/rasa:1.10.18-full
    ports:
      - 5005:5005
    volumes:
      - ./:/app
    command:
      - run
  app:
    image: <image:tag>
    expose: 5055
```

The `expose: 5005` is what allows the `rasa` service to reach the `app` service on that port. To instruct the `rasa` service to send its action requests to that endpoint, add it to your `endpoints.yml`:

```
action_endpoint:
  url: http://app:5055/webhook
```

To run the services configured in your `docker-compose.yml` execute:

```
docker-compose up
```

You should then be able to interact with your bot via requests to port 5005, on the webhook endpoint that corresponds to a [configured channel](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/docker/deploying-in-docker-compose/#docker-compose-configuring-channels):

```
curl -XPOST http://localhost:5005/webhooks/rest/webhook \
  -H "Content-type: application/json" \
  -d '{"sender": "test", "message": "hello"}'
```

## [Configuring a Tracker Store](https://legacy-docs-v1.rasa.com/1.10.18/user-guide/docker/deploying-in-docker-compose/#id5)

By default, all conversations are saved in memory. This means that all conversations are lost as soon as you restart the Rasa server.
If you want to persist your conversations, you can use a different [Tracker Store](https://legacy-docs-v1.rasa.com/1.10.18/api/tracker-stores/#tracker-stores).

To add a tracker store to a Docker Compose deployment, you need to add a new service to your `docker-compose.yml` and modify the `endpoints.yml` to add the new tracker store, pointing to your new service. More information about how to do so can be found in the tracker store documentation:

- [SQLTrackerStore](https://legacy-docs-v1.rasa.com/1.10.18/api/tracker-stores/#sql-tracker-store)
- [RedisTrackerStore](https://legacy-docs-v1.rasa.com/1.10.18/api/tracker-stores/#redis-tracker-store)
- [MongoTrackerStore](https://legacy-docs-v1.rasa.com/1.10.18/api/tracker-stores/#mongo-tracker-store)
- [Custom Tracker Store](https://legacy-docs-v1.rasa.com/1.10.18/api/tracker-stores/#custom-tracker-store)

👋 I can help you get started with Rasa and answer your technical questions.
