refactor docker for mac users CR: Joan

This commit is contained in:
Bernat 2018-04-30 08:46:41 +02:00
parent 3ff20d48d7
commit 09a731c812
4 changed files with 13 additions and 6 deletions

View File

@ -472,7 +472,7 @@ gulp.task('docker-run', async () => {
await execP('docker run -d --name dblocal -p 3306:3306 dblocal');
await runSequenceP('docker-wait');
} catch (err) {
await runSequenceP('docker-image');
await runSequenceP('docker-build');
}
});

View File

@ -4,8 +4,7 @@ WORKDIR /docker-entrypoint-initdb.d
COPY install/ ./
RUN chmod -R 777 .
RUN ./install.sh
USER mysql
CMD ["mysqld"]
CMD ./boot.sh
#HEALTHCHECK --interval=5s --timeout=10s --retries=200 \
# CMD mysqladmin ping -h 127.0.0.1 -u root || exit 1
EXPOSE 3306

View File

@ -0,0 +1,8 @@
#!/bin/bash
find /var/lib/mysql -type f -exec touch {} \; && service mysql start
# Disable SQL strict mode
mysql -u root -proot -e "SET GLOBAL sql_mode='NO_ENGINE_SUBSTITUTION';"
sleep infinity

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Start MySQL service
service mysql start
find /var/lib/mysql -type f -exec touch {} \; && service mysql start
# Disable SQL strict mode
mysql -u root -proot -e "SET GLOBAL sql_mode='NO_ENGINE_SUBSTITUTION';"
@ -15,7 +15,7 @@ done
# Import changes
for file in changes/*/*.sql; do
echo "Imported $file" >> log.txt
mysql -u root -proot < $file
mysql -u root -proot < $file
done
# Import fixtures
@ -23,6 +23,6 @@ echo "Imported fixtures.sql" >> log.txt
mysql -u root -proot < dump/fixtures.sql >> log.txt
# Remove installation
#rm -rf /docker-entrypoint-initdb.d
rm -rf changes dump install.sh