This commit is contained in:
mahek 2025-07-25 17:11:07 +02:00
parent 1f4193f9c0
commit a49db6e4ae
9 changed files with 228 additions and 18 deletions

View file

@ -14,5 +14,9 @@ COPY . .
# Expose port 5000
EXPOSE 5000
# Start the application
CMD ["npm", "run", "dev"]
# Add wait-for script
COPY wait-for-mongodb.sh /wait-for-mongodb.sh
RUN chmod +x /wait-for-mongodb.sh
# Start the application with wait script
CMD ["/wait-for-mongodb.sh", "npm", "run", "dev"]

View file

@ -0,0 +1,9 @@
#!/bin/sh
# wait-for-mongodb.sh
set -e
echo "Attente de MongoDB..."
sleep 10 # Attente simple pour s'assurer que MongoDB a démarré
echo "Démarrage de l'application backend..."
exec "$@"