commit 1023aa147522adec7f631347ec66e58e18a22e1d Author: Julien Pernin Date: Wed Oct 9 15:26:17 2024 +0200 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9da4cd9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM nginx:mainline-alpine + +COPY ./html /usr/share/nginx/html + +RUN chown -R nginx:nginx /usr/share/nginx/html && chmod -R 755 /usr/share/nginx/html && \ + chown -R nginx:nginx /var/cache/nginx && \ + chown -R nginx:nginx /var/log/nginx && \ + chown -R nginx:nginx /etc/nginx/conf.d +RUN touch /var/run/nginx.pid && \ + chown -R nginx:nginx /var/run/nginx.pid + +USER nginx +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c431445 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# WEB DEPLOY + +Ce projet modèle est pour déployer son site web via le CI/CD du garage +Pour plus d'informations: [https://docs.legaragenumerique.xyz/divers/devops/cicd/](https://docs.legaragenumerique.xyz/divers/devops/cicd/) + +## CONFIGURATION + +- Placer son site web dans le dossier html/ : +```bash +├── Dockerfile +├── html +│ ├── content +│ │ ├── page1.html +│ │ ├── page2.html +│ │ └── page3.html +│ ├── css +│ │ └── styles.css +│ └── index.html +└── README.md +``` + +## PUBLICATION + +1. Créer la branche deploy : +```bash +git checkout -b deploy +``` + +2. Pousser la branche deploy : +```bash +git push origin -u deploy +``` + +3. Le site est disponible à l'adresse https://username-nom_du_projet.legaragenumerique.xyz + +exemple pour l'utilisateur greg avec un projet portfolio: +> https://greg-portfolio.legaragenumerique.xyz + +:warning: Ne pas modifier la Dockerfile au risque que le projet ne soit pas déployé + +## MISE A JOUR + +- Pour mettre à jour son projet, pousser les updates sur la branche deploy + +## DEPUBLICATION + +1. Basculer sur une autre branche que deploy : +```bash +git checkout main +``` + +2. Effacer la branche en local : +```bash +git branch -d deploy +``` + +3. Effacer la branche distante : +```bash +git push --delete origin deploy +``` + +> Le site n'est plus en ligne \ No newline at end of file diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..e69de29