How to Set Up a Docker Container (Beginner)

Welcome to this guide on setting up the Sendent for MS Teams Docker container on a Linux system. We'll be using Ubuntu 24 (LTS) for this guide.

As a prerequisite, you need to set up a valid DNS record that points to your Ubuntu installation. Before starting, add a DNS A-record that directs your custom domain to the public IP of your Ubuntu installation. In this guide, we will use the IP '0.0.0.0' for our Ubuntu installation and the A-record 'msteams.sendent.dev'. 

Installation

1. Update packages

First, we'll begin by updating the dependencies in your Ubuntu installation. Please follow any prompts that appear after running the following two commands. 

apt-get update (fetch latest)

apt-get upgrade (download and install)

Depending on the available updates, some follow-up dialogs might appear. The guide does not cover this.

2. Install NGINX

We use NGINX as the reverse proxy, this will allow the Ubuntu installation to bind itself to the necessary docker port. 

apt-get install nginx

3. Install Docker

With the following command, Docker will be downloaded and automatically installed on the Ubuntu machine.

curl -fsSL https://get.docker.com | sudo sh

4. Setting up Sendent for MS Teams

Mount the ./usr directory.

Create a new directory in usr named sendent-msteams.

Create a new text-file, using nano nano docker-compose.yml. See the reference table below, with the exception of DEFAULT_NEXTCLOUD_URL, all variables are required for the container to start.

version: '3.9'
services:
  sendent.msteams:
    image: rg.nl-ams.scw.cloud/sendent-public/sendent-msteams:latest
    build:
      context: ../
      dockerfile: ./Dockerfile
    restart: on-failure
	environment:
      - BASE_URL=<YOURDOMAIN>
      - MSAPP_TYPE=
	  - MSAPP_ID=
	  - MSAPP_PASSWORD=
	  - MSAPP_TENANT_ID=
	  - DEFAULT_NEXTCLOUD_URL=<YOURNEXTCLOUDOMAIN>
    ports:
      - "4200:4200"
    volumes:
      - ./docker-config:/usr/src/app/docker-config
    networks:
      - node_network
networks:
  node_network:

The following table explains the environment variables.

Name Description Example

BASE_URL

This should be the FQDN referencing to your publicly available docker image through reverse proxy.

https://msteams.sendent.dev

MSAPP_TYPE

Default: MultiTenant

MultiTenant

MSAPP_ID

This is the Azure Bot’s app-id.

20d67bc1-6f95-4c2d-a49c-e8463163e30d

MSAPP_PASSWORD

This is the Azure Bot’s password

Example_password_123!

MSAPP_TENANT_ID

Your Azure Tenant ID

92785bec-a2fa-434b-9105-9325e5cb721c

DEFAULT_NEXTCLOUD_URL

Your Nextcloud server FQDN.

https://nextcloud.sendent.dev

 

Save and close the file. Ctrl + XY and hit Enter.

From the same directory, now do: docker compose up -d.

This will download and start the Sendent for MS Teams docker container.

5. Configure NGINX

After installation, navigate to the following folder:

./etc/nginx/sites-enabled

We will use 'nano' a text-editor to modify the config. If it's not there, we will automatically create it. Replace <YOURDOMAIN> with the domain you reserved for this service. For example: <YOURDOMAIN> could be replaced with msteams.sendent.dev.

nano <YOURDOMAIN>.conf

Copy and paste the following. You can paste it in nano with right mouse click. 

Notice, modify the server_name that it reflects your own domain.

server {
    listen 80;
    server_name <YOURDOMAIN>;

    location / {
        proxy_pass http://127.0.0.1:4200;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

You can close and save nano by ctrl + x and when asked to save Y and hit enter.

Verify the NGINX config with nginx -t. There should be no errors.

Now let's reload NGINX by doing systemctl reload nginx.

6. Installing Let's Encrypt.

Within this guide we use the free Let's Encrypt service to enable a safe SSL connection. Let's encrypt will automatically configure our NGINX configuration further. 

apt install certbot python3-certbot-nginx

After installation restart NGINX with systemctl reload nginx

Then we're going to generate the SSL certificates with the following command, notice replace <DOMAIN> with your own.

certbot --nginx -d <DOMAIN>

Example:

certbot --nginx -d msteams.sendent.dev

It will ask to enter your email, to agree with their (Let's Encrypt) Terms and Conditions.

7. Enabling the firewall

NOTE: Please double check if you whitelisted ALL necessary ports. The following section is recommended, but should be double checked on your own installation.

ufw allow 'Nginx Full' (allow port 80 and 443)

ufw allow 'OpenSSH' (allow port 22 ssh)

Warning, if not all the right ports are allowed, you might lose connection to the server or other services may get disrupted. Double check this.

ufw enable (enable firewall)

8. Verify

If all went well, you can now access the manifest file that is hosted on your own server. You can do this for example by navigating in your browser to:

https://<YOURDOMAIN>/manifest.json

Example:

https://msteams.sendent.dev/manifest.json

The response should start with: 

Example response.

Updates

In your usr directory, where the docker compose file is located run these commands, to update to the latest version for Sendent for MS Teams.

# Pull the latest images
docker compose pull

# Stop the running containers
docker compose down

# Remove old containers
docker compose rm -f

# Start the containers with the updated images
docker compose up -d

 

 


Was this article helpful?