diff --git a/infra/prod/Dockerfile b/infra/prod/Dockerfile index f28d0b0..8cea42d 100644 --- a/infra/prod/Dockerfile +++ b/infra/prod/Dockerfile @@ -63,6 +63,7 @@ RUN rm -f /etc/nginx/sites-enabled/default # Configs COPY infra/prod/supervisord.conf /etc/supervisor/conf.d/app.conf COPY infra/prod/nginx.conf /etc/nginx/sites-enabled/inventory.conf +COPY infra/prod/maintenance.html /var/www/html/public/maintenance.html # Backend from stage 1 COPY --from=backend-build /app /var/www/html diff --git a/infra/prod/deploy.sh b/infra/prod/deploy.sh index 026180e..be07eb0 100755 --- a/infra/prod/deploy.sh +++ b/infra/prod/deploy.sh @@ -8,6 +8,9 @@ export INVENTORY_IMAGE_TAG="$TAG" echo "==> Deploying inventory:${TAG}..." +echo "==> Enabling maintenance mode..." +touch maintenance.on + echo "==> Pulling image..." sudo docker compose pull @@ -24,5 +27,8 @@ echo "==> Clearing cache..." sudo docker compose exec -T -u www-data app php bin/console cache:clear --env=prod sudo docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod +echo "==> Disabling maintenance mode..." +rm -f maintenance.on + VERSION=$(sudo docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}') echo "==> Deployed v${VERSION}" diff --git a/infra/prod/maintenance.html b/infra/prod/maintenance.html new file mode 100644 index 0000000..1524568 --- /dev/null +++ b/infra/prod/maintenance.html @@ -0,0 +1,49 @@ + + +
+ + +L'application est temporairement indisponible pour mise à jour. Elle sera de retour dans quelques instants.
+