Coder Social home page Coder Social logo

tp's Introduction

  1. Création de deux dossiers pour chaque image a) Tomcat commande : mkdir mytomcat b) Mypostgres commande : mkdir mypostgres

  2. Récupération du dossier warrepo depuis le github commande : git clone https://github.com/lauryao/warrepo Cela permet de récupérer les fichiers nécessaires pour la base de donnée et l'application web Mettre ensuite le fichier dbproject.war dans le dossier mytomcat et init-db.sql dans mypostgres

  3. Création des deux Dockerfile Pour cela il vous faudra créer un Dockerfile dans chaque dossier (mytomcat et mypostgres) grâce à la commande : vi Dockerfile a) Mytomcat Ecrivez ensuite les instructions suivantes :

FROM tomcat:8-jre8 COPY ./dbproject.war /usr/local/tomcat/webapps

puis sauvegarder.

b) Mypostgres Ecrivez les instructions suivantes :

FROM postgress:9.5 COPY ./init-db.sql docker-entrypoint-initdb.d/ VOLUME ["/var/lib/postgressql/data"]

Sauvegardez de même.

  1. Exécution des conteneurs Pour cette étapes il faudra commencer par construire les images avec la commande : docker build -t mytomcat (pour le docker du tomcat) et docker build -t mypostgres (pour le docker de postgres)

Après avoir construit les images il ne reste plus qu'a créer les conteneurs avec la commande : docker run -d --name db mypostgres (pour le postgres) et docker run -d --name mytomcat -p 8888:80 --link db mytomcat afin de lier les deux conteneurs

  1. Vérification Pour vérifier si notre application fonctionne il faudra ouvrir un navigateur et aller sur le lien : http://192.168.99.100:8888/dbproject/accueil.jsp Entrer ensuite un article et valider celui-ci.

Pour savoir si la base de donnée persiste vous devez l'éteindre et le rallumer. commande : docker stop mytomcat commande : docker stop db puis commande : docker start mytomcat commande : docker start db si tout ce passe bien, les données de l'ancien formulaire devrait être présent.

tp's People

Contributors

undergroundering avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.