Compare commits
10 Commits
89ab312cd1
...
ed7debbba2
| Author | SHA1 | Date | |
|---|---|---|---|
| ed7debbba2 | |||
| 77e2a29c98 | |||
| 52ec58a76d | |||
| c6ad554bc8 | |||
| d41e0eaca8 | |||
| 1808c1c1cf | |||
| e9b8bbc35b | |||
| 28638205d8 | |||
| 6b511c292d | |||
| 333cb589e0 |
11
Dockerfile
11
Dockerfile
@ -1,8 +1,15 @@
|
||||
# Utiliser une image de base légère
|
||||
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
|
||||
EXPOSE 80
|
||||
|
||||
# Démarrer Nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
# Mettre à jour le dépôt à chaque démarrage et lancer Nginx
|
||||
CMD ["/bin/sh", "-c", "/usr/local/bin/update.sh && nginx -g 'daemon off;'"]
|
||||
|
||||
@ -4,11 +4,10 @@ services:
|
||||
ports:
|
||||
- "8084:80"
|
||||
volumes:
|
||||
- ./src:/usr/share/nginx/html # Synchroniser les modifications du dossier src
|
||||
- ./src:/usr/share/nginx/html # Synchronisation locale (si nécessaire)
|
||||
networks:
|
||||
- npm-network
|
||||
- dokploy-network
|
||||
|
||||
networks:
|
||||
npm-network:
|
||||
dokploy-network:
|
||||
external: true
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="vh">
|
||||
<div>
|
||||
<div class="wrap">
|
||||
<h1>Maintenance mode ;) test c</h1>
|
||||
<h1>Maintenance mode !!</h1>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
21
update.sh
Normal file
21
update.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/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