Update on docker
This commit is contained in:
parent
b52519979c
commit
c59d9cb1be
1244
docker/backup.sql
1244
docker/backup.sql
File diff suppressed because it is too large
Load Diff
|
|
@ -19,7 +19,6 @@ services:
|
|||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ../memberflow-api
|
||||
|
|
@ -37,8 +36,6 @@ services:
|
|||
JWT_SECRET: c2VjdXJlc2VjdXJlc2VjdXJlc2VjdXJlMTIzNDU2
|
||||
JWT_EXPIRATION: 7200000
|
||||
|
||||
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ..
|
||||
|
|
@ -48,3 +45,13 @@ services:
|
|||
- backend
|
||||
ports:
|
||||
- "3000:80"
|
||||
|
||||
db-restore:
|
||||
image: mysql:8.0
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ./backup.sql:/backup.sql
|
||||
- ./docker/initdb.sh:/docker-entrypoint-initdb.d/initdb.sh
|
||||
entrypoint: ["/bin/bash", "/docker-entrypoint-initdb.d/initdb.sh"]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
echo "Esperando a que MySQL esté disponible..."
|
||||
until mysql -h mysql -u root -p1234 -e "SELECT 1" > /dev/null 2>&1; do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "Restaurando base de datos desde backup.sql..."
|
||||
mysql -h mysql -u root -p1234 mf_db < /backup.sql
|
||||
Loading…
Reference in New Issue