From 48fca33fdab2dd742ef30acf441360574cb0bda9 Mon Sep 17 00:00:00 2001 From: Eliott-B Date: Fri, 20 Dec 2024 15:20:14 +0100 Subject: [PATCH 1/2] Fix installation instruction --- README.md | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 6e2a443..79185fe 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,11 @@ sudo apt-get install git sudo apt-get update sudo apt-get install python -# Add Docker's official GPG key: -sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc -# Add the repository to Apt sources: echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ @@ -48,29 +45,20 @@ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin :warning: Il faut installer Git avant Docker afin d'éviter des problèmes lors du clone. -1. Cloner la dernière version du projet ([releases](https://www.github.com/444chak/SAE-5/releases)). +1. Lancer le script pour mettre en place les variables d'environnement. ```bash -REPO_URL="https://github.com/444chak/SAE-5.git" -LAST_TAG=$(git ls-remote --tags --sort="v:refname" $REPO_URL | tail -n 1 | awk '{print $2}' | sed 's/refs\/tags\///') -git clone --branch $LAST_TAG --single-branch $REPO_URL -cd SAE-5 +python3 set_env.py ``` -> *Ce script vous permet de récupérer le code du dernier tag présent sur le projet.* - -2. Lancer le script pour mettre en place les variables d'environnement. - -```bash -python set_env.py -``` - -3. Ajouter son utilisateur au groupe Docker. +2. Ajouter son utilisateur au groupe Docker. ```bash sudo usermod -aG docker ``` +3. Redémarrer la console. + ### :rocket: • Démarrage ```bash From d00dbc335885e2bd2b34fd9d68f402e329396777 Mon Sep 17 00:00:00 2001 From: Eliott-B Date: Fri, 20 Dec 2024 15:39:09 +0100 Subject: [PATCH 2/2] Run production web application --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5f36b24..293e2e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,12 +31,12 @@ services: - .env/common networks: - app-network - + web: image: node:23.0 container_name: networkers-web working_dir: /opt/web - command: bash -c "npm install && npm run dev" + command: bash -c "npm install && npm run build && npm run start" volumes: - ./front-js:/opt/web depends_on: