<commit_before># Docker Clustering

If you have your api packaged in a docker container, you can use an orchestration platform to scale the application.

This example assumes you setup docker in the manner specified in [the trails Docker tutorial](docker.md).

## [Docker Swarm](https://docs.docker.com/engine/swarm/)

_docker-compose.yml_
```yml
version: '3'

services:
  some-trails:
    image: trailsjs/trails:latest
    ports:
      - 80:3000
    links:
      - some-mongo:db

  some-mongo:
    image: mongo:latest
    volumes:
      - /volumes/trails_some-trails:/data/db
```

```sh
docker stack deploy --compose-file ./docker-compose.yml trails
docker service scale trails_some-trails=3
```
<commit_msg>Update scaling.md<commit_after># Docker Clustering

If you have your api packaged in a docker container, you can use an orchestration platform to scale the application.

This example assumes you setup docker in the manner specified in the trails [Docker tutorial](docker.md).

## [Docker Swarm](https://docs.docker.com/engine/swarm/)

_docker-compose.yml_
```yml
version: '3'

services:
  some-trails:
    image: trailsjs/trails:latest
    ports:
      - 80:3000
    links:
      - some-mongo:db

  some-mongo:
    image: mongo:latest
    volumes:
      - /volumes/trails_some-trails:/data/db
```

```sh
docker stack deploy --compose-file ./docker-compose.yml trails
docker service scale trails_some-trails=3
```

{'fraction_non_alphanumeric': 0.1090014064697609, 'fraction_numerical': 0.011251758087201125, 'mean_word_length': 3.5463258785942493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6918622', 'n_tokens_mistral': 500, 'n_tokens_neox': 448, 'n_words': 137}