1 Déploiement
wpetit edited this page 2021-07-12 15:25:32 +02:00

Déploiement

La procédure a été testée sur une machine Ubuntu 20.04.

  1. Installer Docker sur la machine

  2. Installer Traefik sur la machine

  3. Créer le fichier de service systemd pour Traefil /etc/systemd/system/traefik.service:

    [Unit]
    Description=Traefik
    After=network.target
    
    [Service]
    Type=simple
    WorkingDirectory=/opt/traefik
    ExecStart=/path/to/traefik -c /opt/traefik/traefik.toml
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
  4. Créer le fichier de configuration pour Traefik /opt/traefik/traefik.toml

    logLevel = "DEBUG"
    
    [accessLog]
    
    [entryPoints]
      [entryPoints.http]
      address = ":80"
        [entryPoints.http.redirect]
          entryPoint = "https"
      [entryPoints.https]
      address = ":443"
        [entryPoints.https.tls]
    
    [acme]
    email = "pcaseiro@cadoles.com"
    storage = "acme.json"
    entryPoint = "https"
      [acme.httpChallenge]
        entryPoint = "http"
    
    [[acme.domains]]
      main = "c2367dd2-beb0-497b-bc27-c704444d42bd.pub.instances.scw.cloud"
    
    [file]
    
    [backends]
      [backends.fdroid-stable]
        [backends.fdroid-stable.servers]
          [backends.fdroid-stable.servers.server0]
            url = "http://127.0.0.1:8080"
      [backends.fdroid-staging]
        [backends.fdroid-staging.servers]
          [backends.fdroid-staging.servers.server0]
            url = "http://127.0.0.1:8081"
    
    [frontends]
      [frontends.fdroid-stable]
      entryPoints = ["http", "https"]
      backend = "fdroid-stable"
        [frontends.fdroid-stable.routes.main]
        rule = "PathPrefix:/staging"
      [frontends.fdroid-staging]
      entryPoints = ["http", "https"]
      backend = "fdroid-staging"
        [frontends.fdroid-staging.routes.main]
        rule = "PathPrefix:/stable"