docker
This commit is contained in:
parent
1f4193f9c0
commit
a49db6e4ae
9 changed files with 228 additions and 18 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
9
backend/wait-for-mongodb.sh
Normal file
9
backend/wait-for-mongodb.sh
Normal 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 "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue