Files
mywiki/container/docker_compose_example.md

4.9 KiB

Docker compose

Tutti i file docker-compose.yml si trovano in /etc/container-name/.

Per eseguire tutti i servizi sottostanti, basta posizionarsi nella cartella che contiene il file docker-compose e lanciare i seguenti comandi:

cd /etc/container-name/

docker compose pull
docker compose up -d

Verificare anche che la configurazione del proxy sia corretta.

Collabora Online Editor

 > cat /etc/collabora/docker-compose.yml

version: '3'

services:
  code:
    container_name: code
    image: collabora/code:latest
    env_file: .env
    restart: unless-stopped
    environment:
    #  - password=${COLLABORA_PASSWORD}
    #  - username=${COLLABORA_USERNAME}
      - domain=${COLLABORA_DOMAIN}
      - dictionaries=en it
      - extra_params=--o:ssl.enable=true --o:ssl.termination=false # Set SSL options
    ports:
      - 9980:9980
    volumes:
      - /etc/localtime:/etc/localtime
      - /etc/timezone:/etc/timezone
    cap_add:
      - MKNOD
    tty: true

env file con le variabili d'ambiente:

 > cat /etc/collabora/.env
#COLLABORA_USERNAME=admin
#COLLABORA_PASSWORD=veecheit0Phophiesh1fahPah0Wue3
COLLABORA_DOMAIN=collabora.domain.com

Uptime Kuma

Si tratta di un tool per il monitoraggio della propria infrastruttura.

Altre info: https://github.com/louislam/uptime-kuma

 > cat /etc/kuma/docker-compose.yml
# Simple docker-compose.yml
# You can change your port or volume location

version: '3.3'

services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    volumes:
      - ./uptime-kuma-data:/app/data
      - /var/run/docker.sock:/var/run/docker.sock ### Per il monitoraggio dei container: è un socket UNIX utilizzato da Docker per la comunicazione remota tra processi. Per default, il socket è accessibile solo localmente, ovvero solo ai processi che girano sullo stesso host
    ports:
      - 3001:3001  # <Host Port>:<Container Port>
    restart: always

Snikket

 > cat /etc/snikket/docker-compose.yml
version: "3.3"

services:
  snikket_proxy:
    container_name: snikket-proxy
    image: snikket/snikket-web-proxy:stable
    env_file: snikket.conf
    network_mode: host
    volumes:
      - snikket_data:/snikket
      - acme_challenges:/var/www/html/.well-known/acme-challenge
    restart: "unless-stopped"
  snikket_certs:
    container_name: snikket-certs
    image: snikket/snikket-cert-manager:stable
    env_file: snikket.conf
    volumes:
      - snikket_data:/snikket
      - acme_challenges:/var/www/.well-known/acme-challenge
    restart: "unless-stopped"
  snikket_portal:
    container_name: snikket-portal
    image: snikket/snikket-web-portal:stable
    network_mode: host
    env_file: snikket.conf
    restart: "unless-stopped"

  snikket_server:
    container_name: snikket
    image: snikket/snikket-server:stable
    network_mode: host
    volumes:
      - snikket_data:/snikket
    env_file: snikket.conf
    restart: "unless-stopped"

volumes:
  acme_challenges:
  snikket_data:

E il file di configurazione:

 > cat /etc/snikket/snikket.conf
# The primary domain of your Snikket instance
SNIKKET_DOMAIN=chat.domain.com
# An email address where the admin can be contacted
# (also used to register your Let's Encrypt account to obtain certificates)
SNIKKET_ADMIN_EMAIL=mail@mail.com
SNIKKET_TWEAK_HTTP_PORT=5080
SNIKKET_TWEAK_HTTPS_PORT=5443

Collegamenti