Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 3.3 KB

SETUP.md

File metadata and controls

51 lines (36 loc) · 3.3 KB

In French

Installation

Développement local

  • Installer NodeJS LTS (>18 ou plus) ;
  • Installer les dépendances du projet avec la commande npm install ;
  • Démarrer le serveur local NextJS avec la commande npm run dev.

Déploiement en production

  • Installer NodeJS LTS (>18 ou plus) ;
  • Installer les dépendances du projet avec la commande npm install ;
  • Modifier la variable d'environnement NEXT_PUBLIC_ENV sur production ;
  • Compiler les fichiers statiques du site Internet avec la commande npm run build ;
  • Supprimer les dépendances de développement avec la commande npm prune --production ;
  • Démarrer le serveur local NodeJS avec la commande npm run start ;
  • (Facultatif) Utiliser Varnish comme serveur de cache HTTP pour atténuer les effets des fortes charges (configuration intégrée).

Tip

Pour tester le projet, vous pouvez également utiliser Docker. Une fois installé, il suffit de lancer l'image Docker de développement à l'aide de la commande docker compose up --detach --build. Le site devrait être accessible à l'adresse suivante : http://localhost:3000/. Si vous souhaitez travailler sur le projet avec Docker, vous devez utiliser la commande docker compose watch --no-up pour que vos changements locaux soient automatiquement synchronisés avec le conteneur. 🐳

Caution

L'image Docker peut également être déployée en production, mais cela nécessite des connaissances approfondies pour déployer, optimiser et sécuriser correctement votre installation, afin d'éviter toute conséquence indésirable. ⚠️

In English

Setup

Local development

  • Install NodeJS LTS (>18 or higher) ;
  • Install project dependencies using npm install ;
  • Start NextJS local server using npm run dev.

Production deployment

  • Install NodeJS LTS (>18 or higher) ;
  • Install project dependencies using npm install ;
  • Set NEXT_PUBLIC_ENV environment variable to production ;
  • Build static website files using npm run build ;
  • Remove development dependencies using npm prune --production ;
  • Start NodeJS local server using npm run start ;
  • (Optional) Use Varnish as an HTTP cache server to mitigate effects of heavy loads (built-in configuration).

Tip

To try the project, you can also use Docker installed. Once installed, simply start the development Docker image with docker compose up --detach --build command. The website should be available at http://localhost:3000/. If you want to work on the project with Docker, you need to use docker compose watch --no-up to automatically synchronize your local changes with the container. 🐳

Caution

The Docker image can also be deployed in production, but this requires advanced knowledge to properly deploy, optimize, and secure your installation, in order to avoid any unwanted consequences. ⚠️