Compare commits
No commits in common. "ed7debbba2797e2ba61b08522552a7ada395313a" and "89ab312cd1ef502d13d295a7c6c2939a5c6b9cad" have entirely different histories.
ed7debbba2
...
89ab312cd1
11
Dockerfile
11
Dockerfile
@ -1,15 +1,8 @@
|
|||||||
# Utiliser une image de base légère
|
# Utiliser une image de base légère
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
# Installer Git
|
|
||||||
RUN apk add --no-cache git
|
|
||||||
|
|
||||||
# Copier le script d'update
|
|
||||||
COPY update.sh /usr/local/bin/update.sh
|
|
||||||
RUN chmod +x /usr/local/bin/update.sh
|
|
||||||
|
|
||||||
# Exposer le port 80
|
# Exposer le port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Mettre à jour le dépôt à chaque démarrage et lancer Nginx
|
# Démarrer Nginx
|
||||||
CMD ["/bin/sh", "-c", "/usr/local/bin/update.sh && nginx -g 'daemon off;'"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
@ -4,10 +4,11 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8084:80"
|
- "8084:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./src:/usr/share/nginx/html # Synchronisation locale (si nécessaire)
|
- ./src:/usr/share/nginx/html # Synchroniser les modifications du dossier src
|
||||||
networks:
|
networks:
|
||||||
- dokploy-network
|
- npm-network
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
dokploy-network:
|
npm-network:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<div class="vh">
|
<div class="vh">
|
||||||
<div>
|
<div>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h1>Maintenance mode !!</h1>
|
<h1>Maintenance mode ;) test c</h1>
|
||||||
<h2><p>Sorry for the inconvenience.<br>Our website is currently undergoing scheduled maintenance.<br><br></p></h2>
|
<h2><p>Sorry for the inconvenience.<br>Our website is currently undergoing scheduled maintenance.<br><br></p></h2>
|
||||||
<p>Thank you for your understanding.</p>
|
<p>Thank you for your understanding.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
21
update.sh
21
update.sh
@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd /usr/share/nginx/html
|
|
||||||
if [ -d ".git" ]; then
|
|
||||||
echo "Updating repository..."
|
|
||||||
git pull origin main
|
|
||||||
else
|
|
||||||
echo "Cloning repository..."
|
|
||||||
git clone http://lab.canguidev.fr/cangui/canguidev.git /usr/share/nginx/html
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Si le dossier src existe après le clone/pull, déplace-le dans /usr/share/nginx/html
|
|
||||||
if [ -d "/usr/share/nginx/html/src" ]; then
|
|
||||||
echo "Moving src to root of Nginx directory..."
|
|
||||||
mv /usr/share/nginx/html/src/* /usr/share/nginx/html/
|
|
||||||
rm -rf /usr/share/nginx/html/src
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Supprimer les fichiers inutiles dans le répertoire de service Nginx
|
|
||||||
rm -f /usr/share/nginx/html/Dockerfile
|
|
||||||
rm -f /usr/share/nginx/html/docker-compose.yml
|
|
||||||
rm -f /usr/share/nginx/html/update.sh
|
|
||||||
Loading…
Reference in New Issue
Block a user