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
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ../memberflow-api
|
context: ../memberflow-api
|
||||||
|
|
@ -37,8 +36,6 @@ services:
|
||||||
JWT_SECRET: c2VjdXJlc2VjdXJlc2VjdXJlc2VjdXJlMTIzNDU2
|
JWT_SECRET: c2VjdXJlc2VjdXJlc2VjdXJlc2VjdXJlMTIzNDU2
|
||||||
JWT_EXPIRATION: 7200000
|
JWT_EXPIRATION: 7200000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
|
|
@ -47,4 +44,14 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
ports:
|
ports:
|
||||||
- "3000:80"
|
- "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