dev/README.md
author ymh <ymh.work@gmail.com>
Fri, 19 Jul 2024 09:38:03 +0200
changeset 704 b5835dca2624
parent 690 5b6102a80205
permissions -rw-r--r--
Adapt renkan preview to uses chrome headless/puppeteer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
686
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
# HDALab Docker images
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
687
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
     3
L'application HDALab a été conteneurisée en 5 services dont 2 nécessite la construction d'une image.
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
     4
Les services sont orchestrés avec l'application `docker-compose`.
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
     5
L'ensemble expose les ports suivant sur l'ordinateur hôte:
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
     6
  - port 8080 : l'interface web HDALab
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
     7
  - port 8025 : Accès à l'interface de consultation [mailhog](https://github.com/mailhog/MailHog).
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
     8
  - port 5432 : port serveur postgresql
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
     9
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    10
## Mise place des images conteneurs docker
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    11
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    12
Deux possibilités existent pour mettre en place les images docker :
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    13
  - construire les images
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    14
  - import des images
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    15
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    16
### Construction des images
686
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
687
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    18
Les commandes suivantes permettent de construire les images. Ces commandes sont à lancer dans le même répertoire que le fichier `docker-compose.yml`.
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    19
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    20
```
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    21
$ ./prepare_docker_build.sh
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    22
$ docker-compose -p hdalab build
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    23
```
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    24
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    25
### Import des images
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    26
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    27
Lancer cette commande pour charger les images du projet.
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    28
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    29
```
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    30
$ docker load -i <chemin/vers/fichier/archives/images>
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    31
```
686
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
## Comment construire les container HDALab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
Toutes les commandes suivantes sont à effectuer dans le répertoire contenant le fichier `docker-compose.yml`.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
$ docker-compose -p hdalab up -d
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
$ docker-compose -p hdalab exec hdalab django-admin collectstatic --noinput
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
$ docker-compose -p hdalab exec hdalab django-admin migrate --noinput
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
$ docker-compose -p hdalab exec hdalab supervisorctl restart all
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
Le site est consultable à l'adresse suivante : [http://127.0.0.1:8080](http://127.0.0.1:8080)
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
Le système est fonctionnel mais avec une bases de donnée vide.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
690
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    47
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    48
### Lancement d'une commande Django
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    49
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    50
Lancer cette commande pour avoir accès à l'utilitaire de gestion Django (c.f. [django-admin](https://docs.djangoproject.com/en/1.8/ref/django-admin/))
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    51
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    52
```
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    53
$ docker-compose -p hdalab exec hdalab django-admin <command> [options]
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    54
```
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    55
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    56
Pour obtenir la liste des commandes disponibles faire:
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    57
```
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    58
$ docker-compose -p hdalab exec hdalab django-admin
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    59
```
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    60
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    61
686
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
### Création d'un "superuser"
690
5b6102a80205 Force add of sh scripts and correct the dev/README.md
ymh <ymh.work@gmail.com>
parents: 687
diff changeset
    63
686
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
Cette commande permet la creation d'un utilisateur administeur de l'application.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
$ docker-compose -p hdalab exec hdalab django-admin createsuperuser
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
### Import des données issues de l'export HDA
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
Cette commande importe les données RDF exportées à partir de l'application HDA.
687
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
    73
Attention cette commande peut être longue (plusieurs heures).
686
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
$ docker-compose -p hdalab exec hdalab /usr/local/sbin/import_hda_rdf.sh /etc/hdalab/data /var/lib/hdalab http://data.culture.fr/entrepot/HDA/export.tgz
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
### Import d'un dump de l'application
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
#### Import d'un dump de la base de donnée
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
Le fichier de dump de base de données doit être décompressé.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
$ docker-compose -p hdalab stop hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
$ docker exec -i hdalab_pg_1 psql -U iri postgres < </chemin/du/fichier/dump/sql.bckp>
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
$ docker-compose -p hdalab start hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
$ docker-compose -p hdalab exec hdalab django-admin migrate --noinput
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
$ echo "from django.contrib.sites.models import Site; site=Site.objects.all()[0]; site.domain='127.0.0.1:8080'; site.name='HDALab'; site.save()" | docker exec -i hdalab_hdalab_1 django-admin shell
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
$ docker-compose -p hdalab exec hdalab django-admin changepassword admin
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
$ docker-compose -p hdalab exec hdalab django-admin rebuild_index --noinput
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
#### Import des miniatures renkan
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
Ces commandes supposent que le service `hdalab` est actif.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
L'archive comprenant l'export des miniatures doit être décompressé.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
Cette archive contient le répertoire `media` à la racine
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
$ docker cp ./media/. hdalab_hdalab_1:/var/lib/hdalab/static/media
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
# Commandes utiles
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
## liste des services
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
Les services suivants sont définis dans le fichier `docker-compose.yml`:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
 - pg : La base de donnée postgresql
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
 - es : ElasticSearch
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
 - mail : Mailhog, fourni un serveur smtp de test
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
 - front : Le serveur web (nginx)
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
 - hdalab : application hdalab comprenant l'application web elle-même et les services associés (envoi de mail et calcul des preevisualisations Renkan)
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
## Démarrage des services
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
Les services se contrôlent avec la commande `docker-compose`.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
La ligne de commande typique est la suivante:
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab [COMMAND] [ARGS...]
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
Il faut bien noter l'utilisation systématique de l'option `-p hdalab` qui spécifie le nom du projet.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   126
Si la commande est lancée dans le même répertoire que celui du fichier `docker-compose.yml` l'option `-f` peut être ignorée.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
## Construction des images des conteneurs
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab build [SERVICE...]
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
## création et lancement des services
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab up -d [SERVICE...]
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
A noter l'option `-d` qui mettent les services en tache de fond.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
## lancement des services
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab run SERVICE [COMMAND] [ARGS...]
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
Cette commande lance un service.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
## Execution d'une commande sur un service lancé
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab exec SERVICE COMMAND [ARGS...]
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   151
## arrêt des services
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab stop [SERVICE...]
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   154
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   155
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   157
## consulter la sortie des containers
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   158
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   159
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab logs [-f] [SERVICE...]
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   160
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   161
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   162
## effacement et recréation de la base de donnée vide
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   163
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   164
Attention, toutes les données de la base seront définitivement supprimées.
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   165
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   166
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
$ docker-compose [-f </path/to/docker-compose.yml>] -p hdalab stop hdalab
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
$ echo "drop database hdalab;\ncreate database hdalab owner iri encoding 'utf-8';" | docker exec -i hdalab_pg_1 psql -U iri postgres
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
```
385e3a12ee27 Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
687
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
   171
## Accès à la base de donnée
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
   172
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
   173
Le port postgresql 5432 est ouvert sur l'ordinateur hôte.
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
   174
La base utilisée par l'application est `hdalab`.
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
   175
L'utilisateur et mot de passe pour y accéder sont :
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
   176
  - utilisateur: `iri`
53fee689f666 Dockerfile correction and add a way to save/load the docker images.
ymh <ymh.work@gmail.com>
parents: 686
diff changeset
   177
  - mot de passe: `iri`