# Docker compose

{% hint style="info" %}
Docker for WriteBackExtreme is production ready since version 5.2.0. All versions before are **not** ready for production.
{% endhint %}

In the following example, we show how easy it is to set up a WriteBackExtreme application instance using the Docker Compose method:

```yaml
version: '3'

services:
  writebackextreme:
    container_name: writebackextreme
    image: ghcr.io/appsfortableau/writeback-extreme:latest
    environment:
      # not commented are required environment variables
      - WBE_LICENSE={License value}
      # note: https:// is automatically be added.
      - WBE_URL={external available domain}
    ports:
      - 8899:8090
    volumes:
      - writebackextreme_data:/app_data

# Create a volume to make the config, sqlite database and logs 
# folder persistend between startup's and updates.
volumes:
  writebackextreme_data:
```

Now you can run the `docker compose up` command to start the composed Docker service.

> Don't forget to add the `-d` to the startup command to "detach" the process, and run it in the background.

### Changing repository database

By default WriteBackExtreme Docker is configured to use `sqlite` as repository database. Via environment variables we have been able to support 3 other databases, to be used as repository database:&#x20;

* [MS SQL Server](https://docs.infotopics.com/writebackextreme/v5.0/installation-guide/getting-started/repository-database#ms-sql-server)
* [PostgreSQL](https://docs.infotopics.com/writebackextreme/v5.0/installation-guide/getting-started/repository-database#postgresql)
* [MySQL](https://docs.infotopics.com/writebackextreme/v5.0/installation-guide/getting-started/repository-database#mysql)

Checkout there documentation for setup environment variables to connect with the repository database.

{% hint style="info" %}
All available image versions can be found [here](https://github.com/appsfortableau/writeback-extreme/pkgs/container/writeback-extreme).
{% endhint %}

### Update WriteBackExtreme container with a new version

If a new version is available, run the following commands to update:

```bash
# First stop the current running instance:
docker-compose stop
# Download/update the latest version based upon image name in the docker-compose.yaml
docker-compose update
# start the docker-compose again, add -d for detatching the docker-compose
docker-compose up -d
```
