Code Monkey home page Code Monkey logo

docker-compose's Introduction

docker-compose

Déploiement en production : Ansible

Pour déployer sur le serveur de production de Statutis, nous utilisons le rôle Ansistrano déclenché par une Github Action, qui va se connecter sur le serveur de production et déployer notre application, en utilisant notamment Docker et Docker Compose.

Déploiement en local

Pour déployer l'application statutis sur votre machine, vous devez disposer de Docker et Docker Compose.

Lancement de l'api

Pour démarrer le serveur de l'api, il suffit d'utiliser le fichier docker-compose.yaml.

docker-compose up -d

Cela aura pour effet de démarrer 3 conteneurs :

  • Une base de données Postgres
  • Le conteneur de la tâche planifiée
  • Le serveur de l'API, exposant un serveur web sur le port 3001

Vous pouvez donc par la suite accéder à la documentation de l'API : http://localhost:3001/swagger.

EN PRODUCTION : il faut absolument modifier la variable d'environnement JWT__secret du conteneur api.

Lancement du site frontend

Il faut tout d'abord cloner le dépôt:

git clone https://github.com/Statutis/frontend.git

Puis modifier le fichier d’environnement .env, afin d'indiquer l'url du site et de l'API. Voici ce fichier dans notre cas :

APP_URL=http://localhost:3000
APP_API_URL=http://localhost:3001

Une fois la configuration achevée, il ne nous reste plus qu'à compiler et lancer notre application

docker run --rm -it -v "$(pwd):/app" -w "/app" node yarn
docker run --rm -it -v "$(pwd):/app" -w "/app" node yarn build
docker run --rm -it -v "$(pwd):/app" -w "/app" -p 3000:3000 node yarn preview --port 3000 --host

On peut alors accéder au site : http://localhost:3000

EN PRODUCTION : Il vaut mieux utiliser un serveur web comme NGINX.

docker-compose's People

Contributors

miithrandiir avatar silvainlud avatar

docker-compose's Issues

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.