Docker & Podman

A Docker image is available on DockerHub. You can run Canaille simply by running the following command:

Run Canaille with the default configuration
$ docker run --name canaille-web -p 8000:8000 yaalcoop/canaille:0.2.7
Run Canaille with the default configuration
$ podman run --name canaille-web -p 8000:8000 yaalcoop/canaille:0.2.7

Canaille is published on the port 8000. It might not be very usable as is though, as it is currently unconfigured, and thus running with a file-based database, without a production ready application server.

Generate a default configuration file with the following command:

Create a default configuration file for Canaille
$ mkdir -p data
$ docker run --rm yaalcoop/canaille:0.2.7 config dump > data/canaille.toml
Create a default configuration file for Canaille
$ mkdir -p data
$ podman run --rm yaalcoop/canaille:0.2.7 config dump > data/canaille.toml

Then edit it as you like. You can find details on the configuration parameters on the dedicated section. Then load the configuration with the following command:

Run Canaille with a configuration file
$ docker run --name canaille-web -p 8000:8000 -v ./data:/data yaalcoop/canaille:0.2.7
Run Canaille with a configuration file
$ podman run --name canaille-web -p 8000:8000 -v ./data:/data yaalcoop/canaille:0.2.7

Worker

If you plan to use a worker for asynchronous tasks (emails, SMS, provisioning), you need to configure a broker like Redis in your canaille.toml and launch the worker:

Run the Canaille worker
$ docker run --name canaille-worker -v ./data:/data yaalcoop/canaille:0.2.7 worker
Run the Canaille worker
$ podman run --name canaille-worker -v ./data:/data yaalcoop/canaille:0.2.7 worker

Docker Compose & Podman Compose

Here is an example of how to embed Canaille in Docker Compose or Podman Compose with a worker and Redis:

docker-compose.yml example with worker
services:
    redis:
        image: redis:alpine
        restart: unless-stopped

    canaille:
        hostname: canaille.localhost
        image: yaalcoop/canaille:latest
        ports:
        - 8000:8000
        volumes:
        - ./data:/data
        environment:
        - CANAILLE_BROKER_URL=redis://redis:6379
        depends_on:
        - redis

    worker:
        image: yaalcoop/canaille:latest
        command: worker
        volumes:
        - ./data:/data
        environment:
        - CANAILLE_BROKER_URL=redis://redis:6379
        depends_on:
        - redis

Run the containers:

Start canaille
$ docker compose up
Start canaille
$ podman compose up

Installer

The install command will apply most of the things needed to get Canaille working. Depending on the configured database it will create the SQL tables, or install the LDAP schemas for instance.

$ docker run --rm -v ./data:/data yaalcoop/canaille:0.2.7 install
$ podman run --rm -v ./data:/data yaalcoop/canaille:0.2.7 install
$ docker compose run --rm canaille install
$ podman compose run --rm canaille install

Vérifier

After installation, you can test the network parameters in your configuration file using the config check command. It will attempt to connect your SMTP server, or your SMPP server if defined.

$ docker run --rm -v ./data:/data yaalcoop/canaille:0.2.7 config check
$ podman run --rm -v ./data:/data yaalcoop/canaille:0.2.7 config check
$ docker compose run --rm canaille config check
$ podman compose run --rm canaille config check

Créer le premier utilisateur

Une fois Canaille installé, vous allez assez rapidement avoir besoin d’ajouter des utilisateurs. Pour créer votre premier utilisateur, vous pouvez utiliser la ligne de commande canaille create.

$ docker run --rm -v ./data:/data yaalcoop/canaille:0.2.7 create user \
    --user-name admin \
    --password admin \
    --emails admin@mydomain.example \
    --given-name George \
    --family-name Abitbol \
    --formatted-name "George Abitbol"
$ podman run --rm -v ./data:/data yaalcoop/canaille:0.2.7 create user \
    --user-name admin \
    --password admin \
    --emails admin@mydomain.example \
    --given-name George \
    --family-name Abitbol \
    --formatted-name "George Abitbol"
$ docker compose run --rm canaille create user \
    --user-name admin \
    --password admin \
    --emails admin@mydomain.example \
    --given-name George \
    --family-name Abitbol \
    --formatted-name "George Abitbol"
$ podman compose run --rm canaille create user \
    --user-name admin \
    --password admin \
    --emails admin@mydomain.example \
    --given-name George \
    --family-name Abitbol \
    --formatted-name "George Abitbol"