====== Installer Tryton avec des images Docker ====== Source: [[https://discuss.tryton.org/t/docker-image-step-by-step-instructions/1238]] ===== Installation ===== Si **Docker** n'est pas encore installé, aller voir [[linux:docker|cette page]]. ==== Télécharger l'image ==== docker pull # Pull an image or a repository from a registry tryton/tryton # Image name ==== Démarrer une instance de PostgreSQL ==== docker run # Run a command in a new container --name tryton-postgres # Assign a name to the container -e POSTGRES_PASSWORD=mysecretpassword # Set environment variable POSTGRES_PASSWORD -e POSTGRES_DB=tryton # Set environment variable POSTGRES_DB -d # Run container in background postgres # Image name ==== Générer la base de données ==== docker run # Run a command in a new container --link tryton-postgres:postgres # Add link to another container -it # Interactive + Allocate TTY tryton/tryton # Image name trytond-admin -d tryton --all # Command and arguments Répondre aux questions suivantes : * **admin email for tryton** : votre adresse mail * **admin password for tryton** : le mot de passe de l'administrateur * le mot de passe est demandé deux fois ==== Démarrer une instance de Tryton ==== docker run # Run a command in a new container --name tryton # Assign a name to the container -p 8000:8000 # Publish a container's port(s) to the host --link tryton-postgres:postgres # Add link to another container -d # Run container in background tryton/tryton # Image name ==== Se connecter à Tryton ==== * Ouvrir un navigateur à l'adresse [[http://:8000/]] * Base de données: **tryton** * User name: **admin** ==== Démarrer une instance "cron" ==== docker run # Run a command in a new container --name tryton-cron # Assign a name to the container --link tryton-postgres:postgres # Add link to another container -d # Run container in background tryton/tryton # Image name trytond-cron -d tryton # Command and arguments ===== Redémarrage ===== Pour redémarrer les instances après un redémarrage du serveur, entrer cette commande : docker start # Start one or more stopped containers tryton-postgres # Image name for PostgreSQL tryton # Image name for Tryton tryton-cron # Image name for cron L'ordre des conteneurs est important ! ===== Arrêt ===== Pour tout stopper c'est la même chose, sauf qu'on remplace ''start'' par ''stop'' : docker stop # Stop one or more running containers tryton-postgres # Image name for PostgreSQL tryton # Image name for Tryton tryton-cron # Image name for cron