• Docker
  • Docker-bower pour Tardistart

Bonjour,

J'essaye d'installer tardistart sous docker avec l'image fstab/docker-bower. J'ai bien lié les fichiers de tardistart (docker run -v "/home/tardistart/:/home/bower/workspace" -t -i fstab/bower) mais le conteneur ne démarrait pas. J'ai ensuite compilé l'image à la main en modifiant le Dockerfile et le script entrypoint.sh pour rajouter les droits sur le répertoire et utiliser l'utilisateur root. Là, tout semble nickel, les logs du serveur http (simple-http-server.log) n'hurlent pas mais je n'accède pas à la page sur le port 8000 de mon serveur. Comment faire ?

Salut,

Alors désolé, mais je comprends pas tout.

Mais pour t'éclairer un peu, tardistart c'est du php, bower est simplement un gestionnaire de dépendances plutôt orienté front (la en l’occurrence c'est pour installer jquery, particles.js etc ...)

Donc là il faudrait créer une image complète, qui installe nodejs, puis bower pour télécharger les dépendances, et installer php et nginx.

    xataz C'est ce que fais l'image fstab/docker-bower. Elle dispose d'un serveur web, de php, nodejs et bower.

    Effectivement il crée un petit serveur web, mais que pour du html/css, il ne gère pas le php. Donc ça irais pour une page statique, mais pas pour tardistart.
    Je verrais si j'ai le temps de créer une image pour Jedediah, mais en sois c'est pas compliqué.

    En [très] gros ça donnerai :

    FROM alpine:3.6
    
    ADD . /app
    
    RUN apk add -U nodejs nodejs-npm php7 \
            && cd /app \
            && npm -y install -g bower \
            && bower install \
            && apk del nodejs nodejs-npm \
            && rm -rf /var/cache/apk/*
    
    WORKDIR /app
    CMD ["php", "-S", "0.0.0.0:8080"]

    Donc là c'est pas très secure, mais le principe est là.

    un mois plus tard

    J'ai modifié le Dockerfile pour que ça fonctionne.

    FROM alpine:3.6
    
    ADD . /app
    
    RUN apk add -U nodejs git nodejs-npm php7 php7-json\
            && cd /app \
            && npm -y install -g bower \
            && bower install --allow-root\
            && apk del nodejs nodejs-npm \
            && rm -rf /var/cache/apk/*
    
    WORKDIR /app
    CMD ["php", "-S", "0.0.0.0:8080"]

    Ça marche très bien. J'ai juste un soucis quand j'essaye d'utiliser le proxy nginx de Jwilder dans mon docker-compose.

    version: '2'
    
    services:
    
      nginx-proxy:
         restart: always
         image: jwilder/nginx-proxy
         ports:
           - "80:80"
           - "443:443"
         volumes:
           - /srv/docker/nginx/certs:/etc/nginx/certs:ro
           - /etc/nginx/vhost.d
           - /usr/share/nginx/html
           - /var/run/docker.sock:/tmp/docker.sock:ro
    
      nginx-proxy-companion:
         image: jrcs/letsencrypt-nginx-proxy-companion
         volumes:
           - /srv/docker/nginx/certs:/etc/nginx/certs:rw
           - /var/run/docker.sock:/var/run/docker.sock
         volumes_from:
           - nginx-proxy
     
     tardistart:
         container_name: tardistart
         build: ./tardistart
         environment:
           - VIRTUAL_HOST=test.toto.fr
           - LETSENCRYPT_HOST=test.toto.fr
           - LETSENCRYPT_EMAIL=contact@toto.fr
         volumes:
           - /srv/docker/tardistart/:/app

    J'obtiens les erreurs suivantes :

    nginx.1    | test.serveur.fr 89.13.155.130 - - [27/Jun/2017:13:10:20 +0000] "GET / HTTP/2.0" 502 173 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:54.0) Gecko/20100101 Firefox/54.0"
    nginx.1    | 2017/06/27 13:10:25 [error] 123#123: *6934 no live upstreams while connecting to upstream, client: 89.13.155.130, server: test.serveur.fr, request: "GET / HTTP/2.0", upstream: "test.serveur.fr", host: "test.serveur.fr"

    J'ai essayé cette solution sans succès 💯 https://github.com/jwilder/nginx-proxy/issues/395

    Je ne connais pas le reverse de jwilder, mais je pense que c'est parce qu'aucun port n'est expose.

    Rajoute EXPOSE 8080 dans le Dockerfile, et rebuild l'image.

    C'est ce que j'ai fait : Rien ne s'affiche dans les logs mais j'arrive sur une page 404 comme si rien n’existait... :

    Not Found
    
    The requested resource / was not found on this server.

    J'ai alors essayé de préciser la racine de tardistart avec le Dockerfile suivant :

    FROM alpine:3.6
    
    ADD . /app
    
    RUN apk add -U nodejs git nodejs-npm php7 php7-json\
            && cd /app \
            && npm -y install -g bower \
            && bower install --allow-root\
            && apk del nodejs nodejs-npm \
            && rm -rf /var/cache/apk/*
    
    WORKDIR /app
    
    EXPOSE 8080
    
    CMD ["php", "-S", "0.0.0.0:8080", "-t", "./app", "./app/index.php"]

    Je ne dois pas être très loin du but maintenant !

    J'ai juste déplacé les fichiers à la racine et désormais ça fonctionne.

    Par contre, je ne peux pas modifier les URLs dans la page admin. Tous les fichiers appartiennent bien à root pourtant...

    [edit] Les logs me disent :

    [Wed Jun 28 17:53:47 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:53:47 2017] PHP Notice:  Use of undefined constant lien - assumed 'lien' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:53:47 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:53:47 2017] PHP Notice:  Use of undefined constant titre - assumed 'titre' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 52
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant lien - assumed 'lien' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant titre - assumed 'titre' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 52
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant lien - assumed 'lien' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant titre - assumed 'titre' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 52
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant lien - assumed 'lien' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant titre - assumed 'titre' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 52
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant lien - assumed 'lien' in /tardistart/admin/index.php on line 49
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant titre - assumed 'titre' in /tardistart/admin/index.php on line 50
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant id - assumed 'id' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 51
    [Wed Jun 28 17:56:53 2017] PHP Notice:  Use of undefined constant icone - assumed 'icone' in /tardistart/admin/index.php on line 52
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56450 [200]: /admin
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56452 [200]: /assets/bower/font-awesome/css/font-awesome.min.css
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56454 [200]: /assets/css/style.css
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56456 [200]: /assets/bower/jquery/dist/jquery.min.js
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56458 [200]: /assets/bower/particles.js/particles.min.js
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56460 [200]: /assets/bower/jeditable/jquery.jeditable.js
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56462 [200]: /assets/js/search.js
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56464 [200]: /assets/js/app.js
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56466 [200]: /assets/js/admin.js
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56468 [200]: /assets/img/tardis.ico
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56470 [200]: /assets/img/bg1.jpg
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56472 [200]: /assets/css/style.css
    [Wed Jun 28 17:56:53 2017] 172.18.0.6:56474 [200]: /assets/img/logo_start_ombre.png
    [Wed Jun 28 17:57:04 2017] 172.18.0.6:56476 [404]: /save.php - No such file or directory

    D'après https://mondedie.fr/d/8002-Discussion-TARDIStart-une-startpage-pour-votre-seedbox/69
    Il s'agit d'un problème de droits sur le répertoire /tardistart/. Pourtant, même après un chmod 777, je ne peux pas modifier l'URL des liens.

    docker exec b83ee843bc1e ls -l /tardistart/admin/
    total 12
    -rwxrwxrwx    1 root     root          2071 Jun 27 11:53 index.php
    -rwxrwxrwx    1 root     root           827 Jun 27 11:53 save.php
    -rwxrwxrwx    1 root     root          1075 Jun 27 11:53 service.json
    Répondre…